Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

123
Visualizações
How do I pass the props from this child component to the parent form

I have a form in this codesandbox

Let's say you select community dialogue in the form and click Next, you will see the error Cannot read property 'm15_19_reached' of undefined in the next step

The PeopleReached component is a child of the App component and it has some input textbox. I am trying to pass props of the value selected from the component textboxes input to the App. But it seems I am missing something in the questions.js where I set the value.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Add a null check for props.question.value inside the value property for all the 6 TextFields.

<TextField
  fullWidth
  name="m15_19_reached"
  type="number"
  value={(props.question.value && props.question.value.m15_19_reached) || ""}
  onChange={handleTextInput1}
  error={props.error && !!props.error.i}
  helperText={props.error ? props.error.i : ""}
  label={"Age 15-19 year"}
  className="form-control"
/>
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda