React Hook Form

Performant, flexible React forms built on hooks with minimal re-renders and built-in validation.

Library
npm
v7.85.0
44,821stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
92/100Excellent
Development Activity100
Maintenance100
Community68
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
88/100Excellent
Architecture90
Code Quality90
Innovation88
Learning Curve85

React Hook Form is a form-state management library for React that uses uncontrolled inputs and refs instead of re-render-heavy controlled components, keeping form interactions fast even with large or deeply nested forms. It exposes a single useForm hook that returns registration helpers, submit handlers, and granular form-state subscriptions, so components only re-render when the specific field or state slice they subscribe to actually changes.

The library ships zero runtime dependencies, embraces native HTML constraint validation out of the box, and layers on optional schema-based validation through a resolvers package that adapts Zod, Yup, Joi, Superstruct, AJV, and others. Its API surface — register, handleSubmit, watch, useController, useFieldArray, useFormContext — has stayed stable across major versions, which combined with first-class TypeScript inference has made it the default forms library for a large share of the React ecosystem, including React Native projects.

What You Get

  • The useForm hook, providing register, handleSubmit, watch, reset, setValue, getValues, and a subscription-based formState object
  • useController and the Controller component for wrapping controlled/third-party UI inputs (MUI, Chakra, Ant Design, etc.) that can’t accept a ref directly
  • useFieldArray for dynamic, appendable/removable lists of form fields (line items, repeated groups)
  • useFormContext for prop-drilling-free access to a shared form instance across deeply nested field components
  • Built-in native HTML validation (required, min, max, pattern) plus an official @hookform/resolvers package bridging Zod, Yup, Joi, Superstruct, AJV, and class-validator schemas
  • Full TypeScript generics that infer field names, types, and error shapes directly from your form’s type or validation schema
  • A DevTools browser extension and companion form-builder for inspecting and scaffolding forms

Common Use Cases

  • Multi-field application forms (signup, checkout, settings) where re-render performance matters as field count grows
  • Forms that need schema-driven validation shared between client and server via a single Zod or Yup schema
  • Dynamic, user-extensible forms with add/remove field groups via useFieldArray (line items, contact lists, survey questions)
  • Wrapping third-party controlled UI component libraries (MUI, Chakra UI, Ant Design) inside a form via Controller
  • React Native forms, since the library has no DOM dependency and works identically off native inputs

Under The Hood

Architecture The library centers on a single factory, createFormControl (src/logic/createFormControl.ts, ~2000 lines), which builds a stateful control object shared by every hook and component in a form tree. useForm (src/useForm.ts) instantiates this control once per form and memoizes it across renders; register attaches refs directly to DOM inputs rather than routing their values through React state, so raw input changes bypass React’s render cycle entirely. Form state (errors, dirtyFields, touchedFields, etc.) is exposed through a subject/observer pattern (createSubject in src/utils) so that useFormState, useWatch, and Controller can each subscribe to only the slices they read, and React only re-renders the specific consumers whose subscribed state actually changed on a given update. useFieldArray and useController layer on top of this same control object to handle dynamic arrays and controlled-component bridging without duplicating the core state machine.

Tech Stack Written entirely in TypeScript (99% of the codebase) with zero runtime dependencies — peerDependencies lists only react (^16.8.0 || ^17 || ^18 || ^19), and validation-schema support is delegated to a separate @hookform/resolvers package rather than bundled in. The build pipeline uses Rollup (scripts/rollup) to produce CJS, ESM, and UMD bundles plus a dedicated React Server Components entry point (index.react-server.ts), and Microsoft’s API Extractor to generate and lint the public .d.ts surface, which is how the project keeps its TypeScript generics stable across releases.

Code Quality Tests are extensive and colocated: src/__tests__ mirrors the hook/logic structure with 115 test files matching 115 non-test source files, run via Jest with @swc/jest for fast TypeScript transpilation and @testing-library/react for hook/component behavior assertions; a separate src/__typetest__ suite type-checks the public generics with tsc. ESLint (flat config, eslint.config.mjs) plus simple-import-sort and Prettier are enforced via Husky + lint-staged pre-commit hooks, and a bundlewatch budget (14.0 kB max for the CJS bundle) gates bundle-size regressions in CI.

API Design The public API is small and consistently named — register, handleSubmit, watch, reset, setValue, getValues — and a minimal quickstart (useForm() + register() + handleSubmit()) is enough to get a validated form working, with Controller as the documented escape hatch for controlled third-party inputs. Generic type inference (form values flow from a single type parameter or a Zod/Yup schema into every hook’s return type) means field-name typos and mismatched validation rules surface as compile errors rather than runtime bugs, which is unusually strong ergonomics for a UI-state library.

Used by 124 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

167

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
TypeScript
99%
Other

Activepieces

Automation · AI Assistants

23,887

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
65
Dependency
Built with
TypeScript99%
Updated today
TypeScript
88%
Other

AFFiNE

Productivity · Project Management · Note Taking

71,668

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
68
Dependency
Built with
TypeScript88%
Updated today
Python
90%
Apache 2.0

Apache Airflow

Data Engineering

46,530

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
66
Dependency
Built with
Python90%
Updated today
TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
TypeScript
84%
MIT

Amical

Note Taking · AI Assistants

1,495

Local-first AI dictation that understands your active app — private, offline, and built for speed.

View details
79
Repo Health
82
Technical
67
Dependency
Built with
TypeScript84%
Updated 3 weeks ago
TypeScript
66%
Apache 2.0

Appsmith

Developer Tools · Automation · No Code Platforms

40,707

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
94
Repo Health
79
Technical
68
Dependency
Built with
TypeScript66%
Java22%
Updated today
Python
68%
Other

AutoGPT

Automation · Productivity · AI Assistants

186,687

Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.

View details
93
Repo Health
78
Technical
67
Dependency
Built with
Python68%
TypeScript31%
Updated today
JavaScript
100%
Other

Automatisch

Automation · No Code Platforms

13,936

Self-hosted, no-code workflow automation that keeps your data on your own servers—a privacy-first alternative to Zapier with 90+ integrations.

View details
49
Repo Health
78
Technical
64
Dependency
Built with
JavaScript100%
Updated 6 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search