Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

127
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda