# React Hook Form Resolvers — card for AI agents

Validation resolvers for React Hook Form supporting Zod, Yup, and others.

Category: Forms, validation and schemas · npm package `@hookform/resolvers` · latest version 7.0.1 (checked 2026-11-01)
Install: `npm install @hookform/resolvers`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## React Hook Form Resolvers
- Install `@hookform/resolvers` alongside the validation library, and import the resolver from its subpath, e.g. `import { zodResolver } from '@hookform/resolvers/zod'`.
- Pass the resolver as `useForm({ resolver: zodResolver(schema) })`. Omitting the generic lets the form types be inferred from the resolver.
- If a Zod schema uses `.default(...)` on a field, do not pass a single generic `useForm`. Either omit the generic or pass all three: `useForm, unknown, z.output>`.
- For Yup, pass context via `useForm({ context })`, not via `yupResolver`'s `schemaOptions.context`, which is overridden.
- `register('age', { valueAsNumber: true })` requires react-hook-form v6.12.0 or later.
- Only set `criteriaMode: 'all'` with resolvers the README table lists as supporting `all`. The default is `firstError`.
- With class-validator, set `"strictPropertyInitialization": false` and `"experimentalDecorators": true` in `tsconfig.json`. With Ajv, use `minLength: 1` to implement a required field.

## What it is
- @hookform/resolvers connects React Hook Form to an outside validation library. The README says it "allows you to use any external validation library such as Yup, Zod, Joi, Vest, Ajv and many others." The repository description lists Yup, Zod, Superstruct, Joi, Vest, Class Validator, io-ts, Nope, computed-types, typanion, Ajv, TypeBox, ArkType, Valibot, effect-ts, VineJS and Standard Schema. The repository was created in April 2020 and is MIT licensed.
- You install the package next to the validation library you already use. You import that library's resolver from its own subpath, wrap your schema in it, and pass the result to `useForm({ resolver })`. React Hook Form's docs list `resolver` as one of two "schema validation props". The other is `context`, an object passed along to the schema validation.
- It is for React Hook Form users who want to write their validation rules as a schema. With most resolvers, the form's value types are also inferred from that schema, so you do not have to declare them separately.

## Caveats
- Inference and error modes vary by library: The README's table marks AJV, ata-validator, fluentvalidation-ts, joi, Nope, typeschema and vest as not inferring values from the schema. It marks Arktype, computed-types, fluentvalidation-ts, io-ts, Nope, Superstruct and typanion as `firstError` only. Check the table before you pick a library.
- Zod `.default()` and a single generic conflict: A Zod field with `.default(...)` is optional on the input type but required on the output type. Writing `useForm<T>` with one type then conflicts with `zodResolver`. The README says to omit the generic or pass all three.
- Yup context belongs on useForm: Context passed through `yupResolver`'s `schemaOptions` is overridden by the form context. The README says to put it in `useForm({ context })` instead.
- class-validator needs tsconfig changes: The class-validator resolver requires `strictPropertyInitialization: false` and `experimentalDecorators: true` in your `tsconfig.json`.
- Ajv required fields use `minLength: 1`: A comment in the README's Ajv example says to use `minLength: 1` to implement a required field. The example sets it on each required string property.

## Numbers (AgentGid data)
- Gid Score: 73.5 (#252 of all tools, 8 of 63 in its category)
- Used in 499 public projects set up for AI coding agents (8.0%)
- Downloads last week: 54,896,165 (as of 2026-11-24), +15.0% over 4 weeks
- GitHub stars: 2,264 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
React Hook Form 99.2%, Zod 98.6%, clsx 92.4%, Tailwind Merge 91.8%, Lucide React 91.6%, Class Variance Authority 87.2%

## Checked alternatives (same job)
- Valibot: https://agentgid.com/tools/valibot/agent.md
- Yup: https://agentgid.com/tools/yup/agent.md
- Formik: https://agentgid.com/tools/formik/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/hookform/
- Homepage: https://react-hook-form.com
- Repository: https://github.com/react-hook-form/resolvers
- Source: https://github.com/react-hook-form/resolvers#readme
- Source: https://github.com/react-hook-form/resolvers
- Source: https://github.com/react-hook-form/resolvers/releases
- Source: https://react-hook-form.com/docs/useform#resolver

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
