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.
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.
A callback that will submit the form. This will also call onSubmit if it was provided.
You should inject this into the form's onSubmit prop.
The form submit event.
Indicates whether the form is valid.
The current form data, before parsing.
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 }.
The current form data, after parsing.
Perform validation on all fields, and return whether the form is valid.
Whether the form is valid.
Generated using TypeDoc
Return value of the
useFormhook. See each property for more information.