MCPcopy Index your code
hub / github.com/react-hook-form/react-hook-form

github.com/react-hook-form/react-hook-form @v7.80.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v7.80.0 ↗ · + Follow
635 symbols 3,106 edges 413 files 7 documented · 1% 368 cross-repo links updated todayv7.81.0 · 2026-07-05★ 44,7854 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
    <a href="https://react-hook-form.com" title="React Hook Form - Simple React forms validation">
        <img src="https://raw.githubusercontent.com/react-hook-form/react-hook-form/master/docs/logo.png" alt="React Hook Form Logo - React hook custom hook for form validation" />
    </a>

npm downloads npm npm Discord

Get started | API | Form Builder | FAQs | Examples

Features

Install

npm install react-hook-form

Quickstart

import { useForm } from 'react-hook-form';

function App() {
  const {
    register,
    handleSubmit,
    formState: { errors },
  } = useForm();

  return (
    <form onSubmit={handleSubmit((data) => console.log(data))}>
      <input {...register('firstName')} />
      <input {...register('lastName', { required: true })} />
      {errors.lastName && 

Last name is required.

}
      <input {...register('age', { pattern: /\d+/ })} />
      {errors.age && 

Please enter number for age.

}
      <input type="submit" />
    </form>
  );
}

Sponsors

We’re incredibly grateful to these kind and generous sponsors for their support!

Major Sponsors

Follower24 BuyFans

Supporting Sponsors

Thanks.dev Workleap Kinsta Sent Niche
Toss Principal Hygraph

Past Sponsors

Thank you to our previous sponsors for your generous support!

Backers

Thanks go to all our backers! [Become a backer].

Contributors

Thanks go to these wonderful people! [Become a contributor].

Documentation website supported and backed by Vercel

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 614
Interface 12
Class 6
Method 3

Languages

TypeScript100%

Modules by API surface

src/logic/createFormControl.ts56 symbols
src/__tests__/useFieldArray.test.tsx22 symbols
src/__tests__/useWatch.test.tsx20 symbols
src/__tests__/useController.test.tsx13 symbols
src/useFieldArray.ts10 symbols
src/__tests__/useForm.test.tsx10 symbols
src/__tests__/useFormState.test.tsx9 symbols
src/__tests__/useFormContext.test.tsx9 symbols
src/__tests__/useForm/resolver.test.tsx9 symbols
src/__tests__/formStateSubscribe.test.tsx9 symbols
src/__tests__/controller.test.tsx9 symbols
scripts/bench-compare.ts9 symbols

Dependencies from manifests, versioned

@emotion/react11.14.0 · 1×
@emotion/styled11.14.0 · 1×
@eslint/compat1.4.1 · 1×
@hookform/resolvers3.9.0 · 1×
@microsoft/api-extractor7.58.9 · 1×
@mui/material5.16.13 · 1×
@rollup/plugin-commonjs28.0.9 · 1×
@rollup/plugin-node-resolve16.0.3 · 1×
@rollup/plugin-terser0.4.4 · 1×
@swc/core1.15.41 · 1×
@swc/jest0.2.39 · 1×

For agents

$ claude mcp add react-hook-form \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page