A mapping of all the fields that have been modified by the user.
If a field is dirty, its key will be true
in this object.
A mapping of the error messages given for each field. Each property is the name of the field and the value is the error message, if any.
If there is no error, the value will be undefined
.
Indicates whether the form is valid.
The current form data, before parsing.
The current form data, after parsing.
Register a field input named key
to the form. This will return props that should be injected into the input.
See each of the options for more information.
Props that should be injected into the input.
The key of the field in the form state.
The type of the input element.
The name of the field.
Optional
options: FieldOptions<T, K>Options for the field.
Set a single field. This will cause the form to re-render.
UseFormReturn.setValues for setting multiple values at once
The name of the field.
The value to set.
Set multiple fields at once. This will cause the form to re-render.
UseFormReturn.setValue for setting a single value
The values to set, as an object of { field: value }
.
Perform validation on all fields, and return whether the form is valid.
Whether the form is valid.
Generated using TypeDoc
Return value of the
useForm
hook. See each property for more information.