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.
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"
/>