Open History to see the last commit
UseField<TParentData>#
A type representing a hook for using a field in a form with the given form data type.
export type UseField = <TField extends DeepKeys<TParentData>>(
opts?: { name: TField } & FieldOptions<
DeepValue<TParentData, TField>,
TParentData
>,
) => FieldApi<DeepValue<TParentData, TField>, TParentData>
- A function that takes an optional object with a
nameproperty and field options, and returns aFieldApiinstance for the specified field.
useField#
export function useField<TData, TParentData>(
opts: FieldOptions<TData, TParentData>,
): FieldApi<TData, TParentData>
A hook for managing a field in a form.
opts: FieldOptions<TData, TParentData>- An object with field options.
Returns#
FieldApi<TData, TParentData>- The
FieldApiinstance for the specified field.
- The
createUseField#
export function createUseField<TParentData>(
formApi: FormApi<TParentData>,
): UseField<TParentData>
A function that creates a UseField hook bound to the given formApi.