useFormStatus
React custom hook for subscribing to the overall form validation and submission status.
import { useFormStatus } from '@jcoreio/zod-forms'
Returns FormStatus
An object with the following properties. Causes a rerender when any of these properties changes.
initialized
- whether the form has been initializedsubmitting
- whether the form is currently submittingsubmitSucceeded
- whether submit succeededsubmitFailed
- whether submit failedsubmitError
- the reason submit failed, if anyvalididationError
- the reason validation failed, if anyvalid
- whether all fields are validinvalid
- opposite ofvalid
pristine
- opposite ofdirty
dirty
- whether any field is unequal to its initial value