Get data in React child component's to parent for submission

Solution 1:

const handleChange=(data)=>{console.log(data)}

Add this function to your parent component.

Pass this function to your child component like <PageOne handleChane={handleChange}/>

You can now access the function in your child component through props.

Call the function like onSubmit={this.props.handleChnage()} and pass the required data as parameter.

If you don't have a submit button in the child components, you need to define each of the onChange handle functions in your parent component and pass them to respective child components as previously mentioned. Then you get the value of form elements in your parent component.