Interface UseFormFieldReturn<TFieldValues, TName>

Interface representing the return value of the useFormField hook.

interface UseFormFieldReturn<TFieldValues, TName> {
    error?: FieldError;
    fieldDescriptionId: string;
    fieldItemId: string;
    fieldMessageId: string;
    id: string;
    invalid: boolean;
    isDirty: boolean;
    isTouched: boolean;
    isValidating: boolean;
    name: TName;
}

Type Parameters

  • TFieldValues extends FieldValues = FieldValues

    The type of field values.

  • TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>

    The name of the field.

Properties

error?: FieldError

The error state of the field, if any.

fieldDescriptionId: string

The ID for the form item description element.

fieldItemId: string

The ID for the form item element.

fieldMessageId: string

The ID for the form item message element.

id: string

The unique identifier for the field item.

invalid: boolean

Indicates if the field is valid.

isDirty: boolean

Indicates if the field value has been modified.

isTouched: boolean

Indicates if the field has been touched.

isValidating: boolean

Indicates if the field is being validated.

name: TName

The name of the field.