In my parent component i have a function called handleDocumentSubmission which i want to pass down to the child.
handleDocumentSubmission = input => async (e) => {
console.log("fired");
I then render the following component like this. I use the same function name.
<FrontConfirm
nextStep={this.nextStep}
handleReview={this.handleReview}
values={values}
handleDocumentSubmission={this.handleDocumentSubmission}
/>
Now in my child component i want to call this function from a child function on click of a button.
continue = () => {
console.log("clicked", this.props);
this.props.handleDocumentSubmission("front");
};
<Button onClick={this.continue}
variant="contained" color="primary">
Confirm
</Button>
Now the console log for clicked i can see with props that has my handleDocumentSubmission function. But the console.log from the parent function console.log("fired") Does not get called.
await this.props.handleDocumentSubmission("front");in thecontinuemethod - samb102