Glossário

Glossary — React Hook Form

Control — the opaque connector object from useForm(), passed to Controller, useController, useWatch, useFieldArray, useFormState, or FormProvider. (Ch08)

Controller — render-prop component that wraps a controlled/third-party input in RHF's registration lifecycle. (Ch28)

criteriaModeuseForm option: firstError (default) collects one error per field, all collects every failed rule. (Ch06, Ch19, Ch33)

defaultValues — the form's initial values, set once via useForm, cached until reset. (Ch06)

deps (register option) — fields to re-validate when this field's own validation runs. (Ch15)

dirtyFields / isDirty — per-field vs. whole-form modification tracking, both compared against defaultValues. (Ch10, Ch32)

errors — the formState object of field validation errors, keyed by field path; also a reactive useForm prop for server-supplied errors. (Ch06, Ch10)

ErrorMessage@hookform/error-message component that renders a field's error message(s). (Ch33)

exact — subscription-matching flag on useWatch/useFormState/useController/Watch/FormState/subscribe; controls prefix vs. exact field-name matching. Default differs per API (false for useWatch/useFormState, true for useController/Controller). (Ch27, Ch28, Ch32, Ch35)

field (Controller/useController return){ onChange, onBlur, value, name, ref, disabled } to spread onto a controlled input. (Ch27, Ch28)

FieldArray — render-prop component wrapping useFieldArray. (Ch30)

FormProvider — Context host for a form's useForm() return, consumed via useFormContext. (Ch38)

FormState (component) — renderless component wrapping useFormState. (Ch34)

getErrors / getValues — non-reactive readers for errors/values; don't subscribe or re-render. (Ch11, Ch13)

getFieldState — returns one field's { invalid, isDirty, isTouched, isValidating, error }. (Ch12)

handleSubmit — wraps a submit callback, validating first; returns a promise resolving with the callback's return value. (Ch14)

isValidformState flag, true only after at least one real validation pass (resolver, non-default mode, or trigger()). (Ch06, Ch10)

mode / reValidateModeuseForm options controlling validation timing before/after first submit. (Ch06)

progressiveuseForm option forwarding validation rules as real HTML attributes for pre-hydration usability. (Ch06, Ch09, Ch15)

register — connects a native input to the form; returns { name, ref, onChange, onBlur }. (Ch15)

Resolver — function type for plugging in Zod/Yup/Joi/etc. validation in place of built-in rules. (Ch03, Ch06)

reset / resetField / resetDefaultValues — whole-form, single-field, and baseline-only reset operations. (Ch16, Ch17, Ch18)

root.* errors — namespace for global/server-level errors not tied to a specific field (e.g. root.serverError). (Ch09, Ch14, Ch19)

setError / clearErrors — manually set/remove field or global errors. (Ch19, Ch07)

setFocus — programmatically focuses a registered field's DOM ref. (Ch20)

setValue / setValues — imperative single-field / batched multi-field value writes. (Ch21, Ch22)

shouldUnregisteruseForm/register/Controller/useFieldArray option; if true, an unmounted input's value/registration is removed instead of retained. Unsupported with useFieldArray. (Ch06, Ch15, Ch28, Ch29)

subscribe — no-render subscription to formState/value changes, returns an unsubscribe function. (Ch23)

trigger — manually runs validation for one/many/all fields, returns Promise<boolean>. (Ch24)

TTransformedValuesuseForm's third generic, typing a resolver's .transform()-reshaped output for handleSubmit. (Ch03, Ch14)

unregister — removes a field's reference/value/built-in-validation; does not affect schema validation. (Ch25)

useController / Controller — hook/component pair for building controlled inputs with full field/fieldState/formState access. (Ch27, Ch28)

useFieldArray / FieldArray — hook/component pair for dynamic arrays of inputs (append, remove, insert, move, swap, update, replace). (Ch29, Ch30)

useForm — the root hook; returns every other API this glossary describes. (Ch06)

useFormContext — reads a form's methods from FormProvider's context. (Ch31)

useFormState / FormState / useFormContext — three ways to read reactive form state, scoped differently for re-render isolation. (Ch10, Ch32, Ch34)

useLens@hookform/lenses hook for type-safe, composable nested-field access (focus, reflect, map, interop, narrow, assert, defined, cast). (Ch37)

useWatch / watch / Watch — three ways to read live field values, scoped differently for re-render isolation. (Ch26, Ch35, Ch36)

validate (register option) — a per-field custom validation function or named-function map. (Ch15)

validate (useForm option) — form-level validation function, mutually exclusive with resolver. (Ch06)

valueAsNumber / valueAsDate / setValueAsregister options that transform the raw input value before validation. (Ch15)