Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!