Weird problem formik setting isSubmitting to false while starting a mutation in the submit method #3987
Unanswered
Jurek-at-work
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am in a react 18 project using Formik 2.4.6.
Since a slight refactoring I experience a weird behaviour with the isSubmitting state in a formik form:
The form has a submit handler like this:
This worked correctly until I moved the Formik container a bit, which shouldn't be a problem... Suddenly formik sets the isSubmitting state to false at the start of the above mutateAsync() call. Directly before this mutate call, the submitting state still is true, but in the first line of the mutation method, the submitting state is false.
My workaround now is to have a setSubmitting(true) in the very first line of the mutation method...
But I have no explanation why the behaviour changed. Is this an intended behaviour, or a bug? Any idea why this is happening? This submit also works as expected otherwise...
Beta Was this translation helpful? Give feedback.
All reactions