Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/content/docs/useform/formstate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This object contains information about the entire form state. It helps you keep
| `isSubmitting` | <TypeText>boolean</TypeText> | `true` if the form is currently being submitted. `false` otherwise.<ul><li>It stays `true` only while the promise returned by your `onSubmit` handler is pending. If you start a request without `await`ing or returning it, `isSubmitting` turns `false` straight away.</li></ul> |
| `isLoading` | <TypeText>boolean</TypeText> | <Since version="7.41.0" /> `true` if the form is currently loading async default values.<ul><li>**Important:** this prop is only applicable to async `defaultValues`<CodeArea withOutCopy rawData={`const {\n formState: { isLoading }\n} = useForm({\n defaultValues: async () => await fetch('/api')\n})`}/></li></ul> |
| `submitCount` | <TypeText>number</TypeText> | The number of times the form has been submitted. |
| `isValid` | <TypeText>boolean</TypeText> | Set to `true` if the form doesn't have any errors.<ul><li>While `isValid` is subscribed, every field (or the whole [resolver](/docs/useform#resolver) schema) is validated on mount and on each change, whatever the [`mode`](/docs/useform#mode). `errors` only fills in according to `mode` and `reValidateMode`, so with the default `mode: "onSubmit"` `isValid` can be `false` while `errors` is still empty.</li><li>`isValid` is not computed while the form is [`disabled`](/docs/useform#disabled).</li><li>`setError` immediately forces `isValid` to `false`; this value is not itself derived from validation and will be overwritten the next time validation runs (e.g. on the next `onChange`, submit, or `trigger()` call).</li></ul> |
| `isValid` | <TypeText>boolean</TypeText> | Set to `true` if the form doesn't have any errors.<ul><li>With [`mode: "onBlur"`](/docs/useform#mode), `isValid` is evaluated on mount when subscribed. Before submission, typing leaves `isValid` unchanged until the field blurs. `errors` only fills in according to `mode` and `reValidateMode`, so with the default `mode: "onSubmit"` `isValid` can be `false` while `errors` is still empty.</li><li>`isValid` is not computed while the form is [`disabled`](/docs/useform#disabled).</li><li>`setError` immediately forces `isValid` to `false`; this value is not itself derived from validation and will be overwritten the next time validation runs (e.g. on the next `onChange`, submit, or `trigger()` call).</li></ul> |
| `isValidating` | <TypeText>boolean</TypeText> | Set to `true` during validation. |
| `validatingFields` | <TypeText>object</TypeText> | <Since version="7.51.0" /> Captures fields that are undergoing asynchronous validation. |
| `errors` | <TypeText>object</TypeText> | An object with field errors. There is also an [ErrorMessage](/docs/useformstate/errormessage) component to retrieve error messages easily. |
Expand Down