What is the purpose of isSubmitting in form state? #952
-
The purpose of isSubmitting is not clear. How do you control this value, how do you update the state of I would like to set The DOC should be clear on the purpose of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It is indeed automatic and is true during the submit process, goes false when form is no longer submitting as the name suggests and is exactly for your use case. Extra explanation: it is set to true when Here for more context (look where form/packages/form-core/src/FormApi.ts Lines 913 to 968 in ade193c I'll try to make a guess, are you awaiting for your async call inside your onSubmit? |
Beta Was this translation helpful? Give feedback.
It is indeed automatic and is true during the submit process, goes false when form is no longer submitting as the name suggests and is exactly for your use case.
Extra explanation: it is set to true when
form.handleSubmit
and is set to false when either:A) Validation is performed and form is invalid
or
B) Form is valid, onSubmit is awaited and it fulfills
Here for more context (look where
done()
is called)form/packages/form-core/src/FormApi.ts
Lines 913 to 968 in ade193c