Formik – How to reset form after confirmation

Hello @Aximili you can use resetForm in onSubmit.

onSubmit={(values, { resetForm }) => {

      // do your stuff 
      resetForm();

}}

what resetForm can do?

Imperatively reset the form. This will clear errors and touched, set isSubmitting to false, isValidating to false, and rerun mapPropsToValues with the current WrappedComponent’s props or what’s passed as an argument. The latter is useful for calling resetForm within componentWillReceiveProps.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)