Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
pproenca avatar

React Hook Form

  • 2.2k installs
  • 186 repo stars
  • Updated July 24, 2026
  • pproenca/dot-skills

react-hook-form is a performance rulebook for client-side React Hook Form validation and subscription patterns.

About

The react-hook-form skill from dot-skills is a 45-rule performance guide across eight categories for client-side controlled forms. Critical areas: form configuration (onSubmit mode, defaultValues, shouldUnregister), field subscription (watch vs useWatch vs subscribe API v7.55+), controlled component integration (MUI, shadcn, Ant Design), validation patterns, useFieldArray dynamic fields, submit lifecycle, and advanced patterns. Explicitly excludes React 19 Server Actions and useActionState (use react-19 skill). Not for TanStack Form nested schema cases or trivial uncontrolled FormData forms. Categories prefixed formcfg-, sub-, ctrl-, valid-, array-, formstate-, integ-, adv- by impact. Use when writing new RHF forms, reviewing performance issues, or integrating UI libraries with useController.

  • 45 prioritized rules across form config, subscription, validation, and arrays.
  • onSubmit validation mode and defaultValues initialization best practices.
  • useWatch and subscribe() API for granular re-render control.
  • Controlled UI integration patterns for MUI and shadcn.
  • Explicitly not for React 19 Server Actions (use react-19 skill).

React Hook Form by the numbers

  • 2,176 all-time installs (skills.sh)
  • +382 installs in the week ending Jul 29, 2026 (Skillselion tracking)
  • Ranked #214 of 2,244 Frontend Development skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 31, 2026 (Skillselion catalog sync)
At a glance

react-hook-form capabilities & compatibility

Capabilities
useform configuration rules · field subscription optimization · controlled component integration · validation pattern guidance · usefieldarray dynamic forms
Use cases
frontend · testing
npx skills add https://github.com/pproenca/dot-skills --skill react-hook-form

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2.2k
repo stars186
Security audit3 / 3 scanners passed
Last updatedJuly 24, 2026
Repositorypproenca/dot-skills

How do I build performant React Hook Form apps without unnecessary re-renders?

Optimize client-side React Hook Form apps with useForm config, subscriptions, controlled components, validation, and field arrays.

Who is it for?

React developers building or auditing client-side forms with React Hook Form.

Skip if: React 19 Server Actions forms (use react-19 skill) or trivial single-field forms.

When should I use this skill?

User mentions React Hook Form, useWatch, useFieldArray, or RHF performance tuning.

What you get

Optimized useForm configuration, subscriptions, and controlled integrations following 45 prioritized rules.

  • Optimized form components
  • Subscription-safe field hooks
  • Async submit handlers

By the numbers

  • Contains 45 rules across 8 categories
  • Version 1.2.0 released May 2026
  • Covers React Hook Form v7.55+ subscribe() API

Files

SKILL.mdMarkdownGitHub ↗

React Hook Form Best Practices by Community

Comprehensive performance optimization guide for React Hook Form applications. Contains 45 rules across 8 categories, prioritized by impact to guide form development, automated refactoring, and code generation.

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 the react-19 skill 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> + FormData is often simpler than pulling in any library

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Form ConfigurationCRITICALformcfg-
2Field SubscriptionCRITICALsub-
3Controlled ComponentsHIGHctrl-
4Validation PatternsHIGHvalid-
5Field ArraysMEDIUM-HIGHarray-
6State ManagementMEDIUMformstate-
7Integration PatternsMEDIUMinteg-
8Advanced PatternsLOWadv-

Quick Reference

1. Form Configuration (CRITICAL)

  • formcfg-validation-mode - Use onSubmit mode for optimal performance
  • formcfg-revalidate-mode - Consider reValidateMode for expensive validation
  • formcfg-default-values - Always provide defaultValues for form initialization
  • formcfg-async-default-values - Use async defaultValues for server data
  • formcfg-should-unregister - Enable shouldUnregister for dynamic form memory efficiency
  • formcfg-useeffect-dependency - Avoid useForm return object in useEffect dependencies
  • formcfg-disabled-prop - Understand that register's disabled prop clears the value

2. Field Subscription (CRITICAL)

  • sub-usewatch-over-watch - Use useWatch instead of watch for isolated re-renders
  • sub-watch-specific-fields - Watch specific fields instead of entire form
  • sub-subscribe-outside-react - Use subscribe() for non-UI side-effects (analytics, autosave)
  • sub-usewatch-with-getvalues - Combine useWatch with getValues for timing safety
  • sub-deep-subscription - Subscribe deep in component tree where data is needed
  • sub-avoid-watch-in-render - Avoid calling watch() in render for one-time reads
  • sub-usewatch-default-value - Provide defaultValue to useWatch for initial render
  • sub-useformcontext-sparingly - Use useFormContext sparingly for deep nesting

3. Controlled Components (HIGH)

  • ctrl-usecontroller-isolation - Isolate controlled inputs in dedicated child components
  • ctrl-avoid-double-registration - Avoid double registration with useController
  • ctrl-controller-field-props - Wire Controller field props correctly for UI libraries
  • ctrl-single-usecontroller-per-component - Use single useController per component
  • ctrl-local-state-combination - Combine local state with useController for UI-only state

4. Validation Patterns (HIGH)

  • valid-resolver-caching - Define schema outside component for resolver caching
  • valid-server-errors - Surface server errors via setError('root.serverError', ...)
  • valid-dynamic-schema-factory - Use schema factory for dynamic validation
  • valid-error-message-strategy - Access errors via optional chaining or lodash get
  • valid-inline-vs-resolver - Prefer resolver over inline validation for complex rules
  • valid-delay-error - Use delayError to debounce rapid error display
  • valid-native-validation - Consider native validation for simple forms

5. Field Arrays (MEDIUM-HIGH)

  • array-use-field-id-as-key - Use field.id as key in useFieldArray maps
  • array-complete-default-objects - Provide complete default objects for field array operations
  • array-separate-crud-operations - Separate sequential field array operations
  • array-unique-fieldarray-per-name - Use single useFieldArray instance per field name
  • array-virtualization-formprovider - Use FormProvider for virtualized field arrays

6. State Management (MEDIUM)

  • formstate-async-submit-lifecycle - Wrap async submit handlers in try/catch and reset on isSubmitSuccessful
  • formstate-destructure-formstate - Destructure formState properties before render
  • formstate-useformstate-isolation - Use useFormState for isolated state subscriptions
  • formstate-getfieldstate-for-single-field - Use getFieldState for single field state access
  • formstate-subscribe-to-specific-fields - Subscribe to specific field names in useFormState
  • formstate-avoid-isvalid-with-onsubmit - Avoid isValid with onSubmit mode for button state

7. Integration Patterns (MEDIUM)

  • integ-shadcn-form-import - Verify shadcn Form component import source
  • integ-shadcn-select-wiring - Wire shadcn Select with onValueChange instead of spread
  • integ-mui-controller-pattern - Use Controller for Material-UI components
  • integ-value-transform - Transform values at Controller level for type coercion

8. Advanced Patterns (LOW)

  • adv-formprovider-memo - Wrap FormProvider children with React.memo
  • adv-devtools-performance - Disable DevTools in production and during performance testing
  • adv-testing-wrapper - Create test wrapper with QueryClient and AuthProvider

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 zod skill
  • For React 19 server actions, see react-19 skill
  • For UI/UX form design, see frontend-design skill

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Related skills

How it compares

Use react-hook-form when enforcing React Hook Form-specific performance rules rather than generic React component guidance.

FAQ

Which validation mode is recommended?

onSubmit mode for optimal performance unless UX requires earlier validation.

How do I limit re-renders on value changes?

Prefer useWatch or subscribe() over watch for granular field subscriptions.

Does this cover Server Actions?

No. Use the react-19 skill for Server Actions and useActionState.

Is React Hook Form safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.