React Hook Form MIT-licensed React form-state and validation library with native-input registration, controlled-component adapters and scoped subscriptions.
Overview React Hook Form is an open-source library for managing form values, validation and submission in React. Its basic workflow registers inputs and runs a callback after validation, while Controller integrates controlled UI components. It can reduce repeated form plumbing in a generated application, but rendering controls and correctly handling server outcomes remain application work.[2] [3] [4]
Contents Registering fields and integrating UI controls The basic hook returns input registration, submission handling and validation state. Native inputs can use registration directly, while Controller adapts external controlled components whose value and event properties differ. Its render function provides change, blur, value, name and ref information. Generated component wrappers must preserve those connections rather than only copy the visible input markup.[2] [3]
Controlled values and field lifecycle Controller requires a defined default value or form-level defaults, and its change callback should not receive undefined as a cleared value. The documentation recommends an appropriate empty or null value instead. It also warns against unregister-on-unmount behavior with field arrays because reordering can trigger unmount/remount cycles. These are data-lifecycle decisions, not just cosmetic rendering options.[3]
Submission results and server failures handleSubmit invokes the success callback after validation, but it does not silently consume exceptions from an asynchronous submission callback. The documentation recommends handling those failures and registering server errors when appropriate. Disabled inputs also do not behave like ordinary retained values. Consequently, a valid-looking form or a completed callback should not be confused with confirmed persistence by an external service.[4]
Subscriptions and dirty-state interpretation useFormState subscribes to selected state within its own scope, reducing unrelated component updates. Its Proxy-backed result requires reading the properties that should participate in the subscription. Default values supply the comparison baseline for dirty state, and field-level dirty markers do not always equal whole-form dirtiness. These distinctions help explain why a generated status indicator might not update as expected.[5]
Editing repeated rows useFieldArray provides operations for adding, moving, replacing and removing rows. The documented update operation remounts the affected fields, which can matter when a row contains local component state. It also expects complete row data for several operations rather than arbitrary partial objects. The library supplies array-state mechanics, while the application still determines the intended editing and validation behavior.[6]
License and substitution React Hook Form is MIT-licensed and can replace TanStack Form for suitable React form workflows. The field APIs, subscriptions and transformed-value handling are not interchangeable. The main documentation website was inaccessible during this research, so the cited official documentation repository supplied the detailed evidence. No installation, form migration or performance test was performed.[1] [2] [7] [8]
Also included: 5 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.