Skip to content

What is the purpose of isSubmitting in form state? #952

Answered by Balastrong
paschaldev asked this question in Q&A
Discussion options

You must be logged in to vote

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)

handleSubmit = async () => {
this.store.setState((old) => ({
...old,
// Submission attempts mark the form as not submitted
isSubmitted: false,
// Count submission attempts
submi…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Balastrong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants