react-hook-form
Installation
SKILL.md
React Hook Form
Overview
React Hook Form is a performant form library that minimizes re-renders. Unlike controlled components (which re-render on every keystroke), RHF uses uncontrolled inputs and only re-renders when necessary. Integrates with Zod for schema validation.
Instructions
Step 1: Basic Form with Zod
npm install react-hook-form @hookform/resolvers zod
// components/SignupForm.tsx — Form with Zod validation
import { useForm } from 'react-hook-form'
import { zodResolver } from '@hookform/resolvers/zod'
import { z } from 'zod'