I am trying to use an additional function on submit as I usually did but it shows it's not a function.
confirmSubmission = () => { // This doesn't work either: confirmSubmission() {
//doSomething();
}
onSubmission(survey, options) {
this.confirmSubmission(); // here it says Uncaught error: confirmSubmission is not a function
}
The function I used:
return (<MyCOmponent model={model} onComplete={this.onSubmission}/>);
Other code that I have within onComplete executes fine if confirmSubmission is not there.
I have a similar code with another function which works perfectly fine in the same component:
componentDidMount() {
this.loadData(); // This works
}
loadData() {
doSomething();
}
I am confused why it doesn't like the confirmSubmission call. Any ideas?