useField()function
useField(name: string, form?: FormStore<{ [name: string]: T }>): SchemaInputProps<Schema<T>, I>| Param | Type | |
|---|---|---|
name | string | Name of the field to read props for. required |
form | FormStore<{ [name: string]: T }> | Form store to read from, defaulting to the current form context. |
Hook that returns the input props for a single named field of a form.
- Subscribes to the form store so the field re-renders when its value or message changes.
Examples
const field = useField("email");