
react-hook-form
React Hook Form performance optimization for client-side form validation using useForm, useWatch, useController, useFieldArray, the subscribe() API, and the Watch / FormStateSubscribe / FieldArray render-prop components. Covers RHF 7.82 additions including resetDefaultValues() and the disabled field-array option. This skill should be used when building client-side controlled forms with React Hook Form library. This skill does NOT cover React 19 Server Actions, useActionState, or server-side form handling (use react-19 skill for those).
- Installs
- 3K
- Last 24h
- +14
- Trending rank
- #7118
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/pproenca/dot-skills --skill react-hook-form- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads react-hook-form automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
React Hook Form Best Practices by Community
Comprehensive performance optimization guide for React Hook Form applications. Contains 35 rules across 7 categories, each naming a decision that goes wrong by default. Verified against react-hook-form 7.82.0.
When to Apply
Reference these guidelines when:
- Writing new forms with React Hook Form
- Configuring useForm options (mode, defaultValues, validation)
- Subscribing to form values with watch / useWatch / subscribe
- Integrating controlled UI components (MUI, shadcn, Ant Design)
- Managing dynamic field arrays with useFieldArray
- Handling async submit, server errors, and submit lifecycle state
- Reviewing forms for performance issues
When NOT to Use This Skill
- React 19 Server Actions /
useActionState— use thereact-19skill instead - Deeply nested, fully type-safe forms — TanStack Form may be a better fit for forms with complex nested schemas; this skill assumes you've already chosen RHF
- Single-input or trivial forms — uncontrolled
<form>+FormDatais often simpler than pulling in any library
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Form Configuration | CRITICAL | formcfg- |
| 2 | Field Subscription | CRITICAL | sub- |
| 3 | Controlled Components | HIGH | ctrl- |
| 4 | Validation Patterns | HIGH | valid- |
| 5 | State Management | MEDIUM-HIGH | formstate- |
| 6 | Field Arrays | MEDIUM-HIGH | array- |
| 7 | Integration Patterns | MEDIUM | integ- |
Quick Reference
1. Form Configuration (CRITICAL)
formcfg-default-values- Always Provide defaultValues for Form Initializationformcfg-useeffect-dependency- Depend on formState Slices, Not on formState Itselfformcfg-validation-mode- Justify Any mode Other Than the Default onSubmitformcfg-revalidate-mode- Keep Default reValidateMode Unless Validation Is Expensiveformcfg-should-unregister- Keep shouldUnregister Off Unless Hidden Fields Must Leave the Payloadformcfg-transformed-values-generic- Pass the Third useForm Generic When the Resolver Transforms Valuesformcfg-async-default-values- Use Async defaultValues for Server Dataformcfg-disabled-prop- Use the HTML disabled Attribute for Visual Disabling, Not register's disabled Optionformcfg-values-prop- Use the values Prop to Keep a Form in Sync with Server Data
2. Field Subscription (CRITICAL)
sub-avoid-watch-in-render- Avoid Calling watch() in Render for One-Time Readssub-memo-cannot-beat-context- React.memo Cannot Stop Context-Driven Re-renders Under FormProvidersub-subscribe-outside-react- Use subscribe() to React to Form Changes Outside the React Lifecyclesub-render-prop-components- Use the Render-Prop Components to Isolate Re-renders Without a Child Componentsub-useformcontext-sparingly- Use useFormContext Sparingly for Deep Nestingsub-usewatch-over-watch- Use useWatch Instead of watch for Isolated Re-renderssub-watch-specific-fields- Watch Specific Fields Instead of Entire Form
3. Controlled Components (HIGH)
ctrl-usecontroller-isolation- Isolate Controlled Inputs in Dedicated Child Componentsctrl-controller-field-props- Wire Controller Field Props Correctly for UI Libraries
4. Validation Patterns (HIGH)
valid-resolver-caching- Build the Validation Schema Once, Outside the Render Pathvalid-valueasnumber-empty-nan- Handle the NaN valueAsNumber Produces for an Empty Inputvalid-server-errors- Surface Server Errors via setError('root.serverError', ...)valid-delay-error- Use delayError to Debounce Rapid Error Display
5. State Management (MEDIUM-HIGH)
formstate-avoid-isvalid-with-onsubmit- Avoid isValid with onSubmit Mode for Button Stateformstate-destructure-formstate- Read Every formState Property You Depend On During Renderformstate-reset-default-values- Rebase Defaults with resetDefaultValues After a Successful Saveformstate-handlesubmit-oninvalid- Use handleSubmit's Second Argument to Handle a Rejected Submitformstate-useformstate-isolation- Use useFormState for Isolated State Subscriptionsformstate-async-submit-lifecycle- Wrap Async Submit Handlers in try/catch and Reset on isSubmitSuccessful
6. Field Arrays (MEDIUM-HIGH)
array-separate-crud-operations- Separate Sequential Field Array Operationsarray-use-field-id-as-key- Use field.id as Key in useFieldArray Mapsarray-unique-fieldarray-per-name- Use Single useFieldArray Instance Per Field Namearray-disabled-silently-noops- useFieldArray's disabled Option Makes Every Mutation a Silent No-op
7. Integration Patterns (MEDIUM)
integ-value-transform- Transform Values at Controller Level for Type Coercioninteg-shadcn-form-import- Verify shadcn Form Component Import Sourceinteg-shadcn-select-wiring- Wire shadcn Select with onValueChange Instead of Spread
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
- Reference files:
references/{prefix}-{slug}.md
Related Skills
- For schema validation with Zod resolver, see
zodskill - For React 19 server actions, see
react-19skill - For UI/UX form design, see
frontend-designskill
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
FAQ
What does the react-hook-form skill do?
React Hook Form performance optimization for client-side form validation using useForm, useWatch, useController, useFieldArray, the subscribe() API, and the Watch / FormStateSubscribe / FieldArray render-prop components. Covers RHF 7.82 additions including resetDefaultValues() and the disabled field-array option. This skill should be used when building client-side controlled forms with React Hook Form library. This skill does NOT cover React 19 Server Actions, useActionState, or server-side form handling (use react-19 skill for those).
How do I install react-hook-form?
Run npx skills add https://github.com/pproenca/dot-skills --skill react-hook-form in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/react-hook-form/ (personal) or .claude/skills/react-hook-form/ (project).
Which AI agents can use react-hook-form?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is react-hook-form safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains react-hook-form?
It is published by pproenca in pproenca/dot-skills. It has 3,003 recorded installs.
More from pproenca/dot-skills
zod
pproenca/dot-skills
Zod schema validation best practices for type safety, parsing, and error handling. This skill should be used when defining z.object schemas, using z.string validations, safeParse, or z.infer. This skill does NOT cover React Hook Form integration patterns (use react-hook-form skill) or OpenAPI client generation (use orval skill).
vitest
pproenca/dot-skills
Vitest testing framework patterns for test setup, async testing, mocking with vi., snapshots, and test performance (formerly test-vitest). This skill should be used when writing or debugging Vitest tests. This skill does NOT cover TDD methodology (use test-tdd skill), API mocking with MSW (use test-msw skill), or Jest-specific APIs.
emilkowal-animations
pproenca/dot-skills
Emil Kowalski's animation best practices for web interfaces. Use when writing, reviewing, or implementing animations in React, CSS, or Framer Motion. Triggers on tasks involving transitions, easing, gestures, toasts, drawers, or motion.
nuqs
pproenca/dot-skills
nuqs (type-safe URL query state) best practices for Next.js and other React frameworks. This skill should be used when writing, reviewing, or refactoring code that uses nuqs for URL state management. Triggers on tasks involving useQueryState, useQueryStates, search params, URL state, query parameters, nuqs parsers, limitUrlUpdates, Standard Schema, NuqsAdapter, or Next.js routing with state.
clean-architecture
pproenca/dot-skills
Clean Architecture principles and best practices from Robert C. Martin's book. This skill should be used when designing software systems, reviewing code structure, or refactoring applications to achieve better separation of concerns. Triggers on tasks involving layers, boundaries, dependency direction, entities, use cases, or system architecture.
typescript
pproenca/dot-skills
TypeScript performance, tsconfig, type errors, async patterns — triggered when the user asks to "optimize TypeScript performance", "speed up tsc compilation", "configure tsconfig.json", "fix type errors", "improve async patterns", or encounters TS errors (TS2322, TS2339, "is not assignable to"). Also triggers on .ts, .tsx, .d.ts file work involving type definitions, module organization, or memory management. Does NOT cover TypeScript basics, framework-specific patterns, or testing.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.