type BaseFormState<TFormData>: object;
type BaseFormState<TFormData>: object;
An object representing the current state of the form.
• TFormData
errorMap: FormValidationErrorMap;
errorMap: FormValidationErrorMap;
The error map for the form itself.
fieldMetaBase: Record<DeepKeys<TFormData>, FieldMetaBase>;
fieldMetaBase: Record<DeepKeys<TFormData>, FieldMetaBase>;
A record of field metadata for each field in the form, not including the derived properties, like errors and such
isSubmitted: boolean;
isSubmitted: boolean;
A boolean indicating if the form has been submitted.
isSubmitting: boolean;
isSubmitting: boolean;
A boolean indicating if the form is currently in the process of being submitted after handleSubmit is called.
Goes back to false when submission completes for one of the following reasons:
Note: if you're running async operations in your onSubmit function make sure to await them to ensure isSubmitting is set to false only when the async operation completes.
This is useful for displaying loading indicators or disabling form inputs during submission.
isValidating: boolean;
isValidating: boolean;
A boolean indicating if the form or any of its fields are currently validating.
submissionAttempts: number;
submissionAttempts: number;
A counter for tracking the number of submission attempts.
validationMetaMap: Record<ValidationErrorMapKeys, ValidationMeta | undefined>;
validationMetaMap: Record<ValidationErrorMapKeys, ValidationMeta | undefined>;
An internal mechanism used for keeping track of validation logic in a form.
values: TFormData;
values: TFormData;
The current values of the form fields.
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.