Skip to content
Back to skills

React Hook Form

ASecurity

React Hook Form — performant form management with uncontrolled inputs, validation, and field arrays.

  • 47 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 12, 2026
toolsreactperformance

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add skeletorflet/opencode-supreme-setup --skill react-hook-form --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of React Hook Form?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for React Hook Form
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/skeletorflet-react-hook-form/badge)](https://www.skillsdirectory.com/skills/skeletorflet-react-hook-form)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: react-hook-form
description: React Hook Form — performant form management with uncontrolled inputs, validation, and field arrays.
---

## react-hook-form

### useForm & Register
- `useForm({ defaultValues: { name: '' } })` — initialize form context.
- `register('name', { required: true })` — spread into `<input>` for uncontrolled binding.
- `register('email', { pattern: /^\S+@\S+$/ })` — inline validation rules.
- `register('age', { valueAsNumber: true })` — automatic type coercion.

### Validation
- Native rules: `required`, `minLength`, `maxLength`, `min`, `max`, `pattern`, `validate`.
- `validate: (val) => val.length > 3 || 'too short'` — custom sync/async validator.
- Schema validation: `zodResolver(schema)` / `yupResolver(schema)` from `@hookform/resolvers`.
- `shouldUseNativeValidation: true` — browser-native validation messages.

### Errors & Form State
- `formState.errors.name?.message` — per-field error object from validation.
- `formState.isDirty`, `isSubmitting`, `isValid`, `submitCount` — reactive form state.
- `trigger('email')` — manually validate a single field.
- `setError('name', { message: 'taken' })` — server-side validation errors.

### useFieldArray
- `useFieldArray({ control, name: 'items' })` — dynamic list of fields.
- `fields.map((item, i) => <input key={item.id} {...register(`items.${i}.value`)} />)`.
- Methods: `append`, `prepend`, `remove`, `insert`, `swap`, `move`, `replace`.
- Each field needs unique `id` from `fields` array (not index as key).

### Controller & Performance
- `<Controller render={({ field }) => <Select {...field} />} name="country" control={control} />`.
- Uncontrolled inputs = minimal re-renders; `Controller` for custom/third-party components.
- `useWatch({ name: 'field' })` — subscribe to field changes without re-render.
- `useFormContext()` / `<FormProvider>` — shared form context for deeply nested components.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.