Reputation: 1101
I am using redux-form and react-redux.
This is the warning I am getting.
You will notice that is points to 3 places in my code CreateNewOrderForm.jsx:39, NewOrderFormFour.jsx:65, and NewOrderFormFour.jsx:122.
I need another pair eyes to look at it.
CreateNewOrderForm.jsx:39:
toggleDialog = (id) => {
const { dialog, openDialogFunction, closeDialogFunction } = this.props;
if (dialog.show && (dialog.id === 'confirmOrderDialog' || 'confirmOrderDialog')) {
closeDialogFunction(id);
}
else {
openDialogFunction(id, 1);
}
}
NewOrderFormFour.jsx:65:
openConfirmationDialog = () => {
const { openDialogFunction } = this.props;
openDialogFunction('confirmOrderDialog');
}
NewOrderFormFour.jsx:122:
<Form
id="createOrder"
onSubmit={ handleSubmit(this.openConfirmationDialog()) }
>
Do I need to call the this.openConfirmationDialog
method in the handleSubmit?
Or put it in a callback?
Struggled to pinpoint the error since i get over 1000 of them.
What could i change to get this to work?
Upvotes: 1
Views: 67
Reputation: 7764
I think you need to use arrow funcion in submit onSubmit={() => handleSubmit(this.openConfirmationDialog()) }
. In your variant you call this function when component rendering.
Upvotes: 2