关于 react-hook-form
面向 React Hook Form v7 的参考技能,按任务映射到分类目录和详细文档,帮助开发者查找 API、类型及用法资料。
主要功能
- 01覆盖 React Hook Form v7 API 文档
- 02按任务映射文档类别
- 03提供 API、TypeScript 与进阶主题索引
- 04包含示例和脚本文档入口
适用场景
- 01查询 useForm 或 Controller 的用法
- 02查找字段验证与 TypeScript 类型
- 03了解无障碍、测试或性能主题
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ fandhe-ai/ agent-reference-skills --skill react-hook-form安装后在 Claude Code 中输入/react-hook-form确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
references/advanced/accessibility.mdconnect-form.mdcontrolled-mixed-uncontrolled.mdcustom-hook-resolver.mderror-messages.mdformprovider-performance.mdREADME.mdregistering-opaque-types.mdserver-actions.mdsmart-form-component.mdtesting-form.mdtransform-and-parse.mdvirtualized-lists.mdwizard-form.mdreferences/api/controller.mdcreateformcontrol.mderrormessage.mdfieldarray-component.mdformprovider.mdformstatesubscribe.mdREADME.mdusecontroller.mdusefieldarray.mduseform-clearerrors.mduseform-control.mduseform-form.mduseform-formstate.mduseform-geterrors.mduseform-getfieldstate.mduseform-getvalues.md详细介绍
React Hook Form v7 参考
涵盖 React Hook Form v7 全部 API 文档的技能。 根据用户的任务读取相应的 README.md,并从中找到具体文件。
适用版本
- 库:react-hook-form v7.90.0(GitHub Releases 中的最新稳定版本,于 2026-10-10 发布。v8.0.0-beta.4 属于预发布版本,因此不在适用范围内)
- 文档原文:GitHub
react-hook-form/documentation的 master commit2ab1b24db1292116df5f5611253017a5eafd4833(当前发布标签仅涵盖 v1〜v3,因此固定到 commit),于 2026-10-16 获取 - 参考地址:https://react-hook-form.com(`/docs/...`、`/get-started`、`/ts`、`/advanced-usage`、`/dev-tools`)
ErrorMessage从 v7.88 起内置于主体中。FormState(旧称FormStateSubscribe)的文件名保持为formstatesubscribe.md
目录结构
skills/react-hook-form/
SKILL.md
references/
get-started/
README.md
installation.md
register-fields.md
apply-validation.md
integrating-existing-form.md
ui-libraries.md
controlled-inputs.md
global-state.md
handle-errors.md
integrating-services.md
schema-validation.md
react-native.md
typescript-quickstart.md
design-philosophy.md
api/
README.md
useform.md
usecontroller.md
useformcontext.md
usewatch.md
useformstate.md
usefieldarray.md
uselens.md
createformcontrol.md
useform-register.md
useform-unregister.md
useform-formstate.md
useform-watch.md
useform-subscribe.md
useform-handlesubmit.md
useform-reset.md
useform-resetfield.md
useform-resetdefaultvalues.md
useform-seterror.md
useform-clearerrors.md
useform-setvalue.md
useform-setvalues.md
useform-setfocus.md
useform-getvalues.md
useform-geterrors.md
useform-getfieldstate.md
useform-trigger.md
useform-control.md
useform-form.md
controller.md
formprovider.md
watch-component.md
fieldarray-component.md
errormessage.md
formstatesubscribe.md
typescript/
README.md
resolver.md
submit-handler.md
control.md
use-form-return-props.md
use-form-method-types.md
component-props-types.md
field-array-types.md
controller-types.md
error-types.md
field-path-types.md
mode-register-options.md
form-state-types.md
opaque-types.md
nested-value.md
advanced/
README.md
accessibility.md
wizard-form.md
smart-form-component.md
error-messages.md
connect-form.md
formprovider-performance.md
controlled-mixed-uncontrolled.md
custom-hook-resolver.md
virtualized-lists.md
testing-form.md
transform-and-parse.md
server-actions.md
registering-opaque-types.md
faqs/
README.md
faqs.md
dev-tools/
README.md
devtools.md
samples/
README.md
basic-form.md
schema-validation.md
controlled-component.md
field-array.md
form-provider.md
async-submit.md
watch-conditional-fields.md
reset-after-submit.md
typescript-typed-form.md
scripts/
README.md
install.md
develop.md
探索步骤
根据任务查找类别,并在该类别的 README.md 中确定目标页面:
- 在下方映射表中查找与任务对应的类别
- 参阅该类别的
references/{category}/README.md,确定目标页面 - Read 相应页面的
.md文件,确认详情
任务 → 类别映射
| 任务 | 类别 | 参考 README |
|---|---|---|
| 安装、创建基本表单、验证规则、模式集成、React Native、UI 库集成 | get-started | references/get-started/README.md |
| useForm、register、handleSubmit、reset、watch、setValue、getValues、getErrors | api | references/api/README.md |
| Controller、useController、FormProvider、useFormContext | api | references/api/README.md |
| useFieldArray / FieldArray(动态字段)、useLens、createFormControl | api | references/api/README.md |
| useWatch、useFormState、subscribe、formState、FormState(旧称 FormStateSubscribe) | api | references/api/README.md |
| 使用 ErrorMessage(从 v7.88 起内置于主体中)显示错误 | api | references/api/README.md |
| 类型定义、泛型、Resolver / SubmitHandler / UseFormReturn / FieldErrors / RegisterOptions / OpaqueTypes、FieldPath | typescript | references/typescript/README.md |
| Server Actions / useActionState、Smart Form、Connect Form、FormProvider 性能、Transform and Parse | advanced | references/advanced/README.md |
| 无障碍、向导表单、测试、虚拟列表 | advanced | references/advanced/README.md |
| 性能、类组件、watch 与 getValues 的比较、条件渲染 | faqs | references/faqs/README.md |
| DevTools 的安装和调试 | dev-tools | references/dev-tools/README.md |
| 了解常见用法、参考实现示例 | samples | samples/README.md |
| 了解安装和开发环境设置命令 | scripts | scripts/README.md |
评论
支持 Markdown