Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-hook-form

> 前端框架
Open source

📋 React Hooks for form state management and validation (Web + React Native)

44.8K stars0 likes4 views
WebsiteGitHub

About

📋 React Hooks for form state management and validation (Web + React Native)

Get started | API | Form Builder | FAQs | Examples

Features

  • Built with performance, UX and DX in mind
  • Embraces native HTML form validation
  • Out of the box integration with UI libraries
  • Small size and no dependencies
  • Supports Yup, Zod, AJV, Superstruct, Joi and others

Install

bash
npm install react-hook-form

Quickstart

javascript
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 && <p>Last name is required.</p>}
      <input {...register('age', { pattern: /\d+/ })} />
      {errors.age && <p>Please enter a number for age.</p>}
      <input type="submit" />
    </form>
  );
}

Sponsors

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

Major Sponsors

Follower24

Supporting Sponsors

Thanks.dev Kinsta Niche 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

Issues· 9 open

View all issuesOpen on GitHub
  • #13809

    useWatch does not update when a deeply nested field changes

    status: need more detailUpdated Sep 30, 2026
  • #13751

    setValues with nested partials wipes untouched sibling values

    Updated Sep 17, 2026
  • #13749

    useFieldArray over a null default marks the form dirty on mount

    Updated Sep 17, 2026
  • #12298

    Correct behaviour for apps using react-compiler

    V8react 19Updated Sep 3, 2026

> Tags

TypeScriptdxform-builderformsreact-hooks

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架