Accepted answer

There are multiple ways you can approach this, one would be to call your saveForm inside onSubmit function of Formik component and pass the parameter which handle to your saveForm which handles the reset event. Example

 onSubmit:{(form, actions, resetForm ) => {
      saveForm(form, actions);

   const saveForm = (form, { resetForm }) => {
        //save form code

or You can directly set it to the onSubmit function like this


This will directly pass all the parameter that onSubmit is recieving to your saveForm function.

Related Query

More Query from same tag