mcpField
R
react-hook-form

react-hook-form

github.com/fandhe-ai开发498 次安装4 天前更新
代码仓库

关于 react-hook-form

面向 React Hook Form v7 的参考技能,按任务映射到分类目录和详细文档,帮助开发者查找 API、类型及用法资料。

主要功能

  1. 01覆盖 React Hook Form v7 API 文档
  2. 02按任务映射文档类别
  3. 03提供 API、TypeScript 与进阶主题索引
  4. 04包含示例和脚本文档入口

适用场景

  1. 01查询 useForm 或 Controller 的用法
  2. 02查找字段验证与 TypeScript 类型
  3. 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.md
connect-form.md
controlled-mixed-uncontrolled.md
custom-hook-resolver.md
error-messages.md
formprovider-performance.md
README.md
registering-opaque-types.md
server-actions.md
smart-form-component.md
testing-form.md
transform-and-parse.md
virtualized-lists.md
wizard-form.md
references/api/
controller.md
createformcontrol.md
errormessage.md
fieldarray-component.md
formprovider.md
formstatesubscribe.md
README.md
usecontroller.md
usefieldarray.md
useform-clearerrors.md
useform-control.md
useform-form.md
useform-formstate.md
useform-geterrors.md
useform-getfieldstate.md
useform-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 commit 2ab1b24db1292116df5f5611253017a5eafd4833(当前发布标签仅涵盖 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 中确定目标页面:

  1. 在下方映射表中查找与任务对应的类别
  2. 参阅该类别的 references/{category}/README.md,确定目标页面
  3. Read 相应页面的 .md 文件,确认详情

任务 → 类别映射

任务类别参考 README
安装、创建基本表单、验证规则、模式集成、React Native、UI 库集成get-startedreferences/get-started/README.md
useForm、register、handleSubmit、reset、watch、setValue、getValues、getErrorsapireferences/api/README.md
Controller、useController、FormProvider、useFormContextapireferences/api/README.md
useFieldArray / FieldArray(动态字段)、useLens、createFormControlapireferences/api/README.md
useWatch、useFormState、subscribe、formState、FormState(旧称 FormStateSubscribe)apireferences/api/README.md
使用 ErrorMessage(从 v7.88 起内置于主体中)显示错误apireferences/api/README.md
类型定义、泛型、Resolver / SubmitHandler / UseFormReturn / FieldErrors / RegisterOptions / OpaqueTypes、FieldPathtypescriptreferences/typescript/README.md
Server Actions / useActionState、Smart Form、Connect Form、FormProvider 性能、Transform and Parseadvancedreferences/advanced/README.md
无障碍、向导表单、测试、虚拟列表advancedreferences/advanced/README.md
性能、类组件、watch 与 getValues 的比较、条件渲染faqsreferences/faqs/README.md
DevTools 的安装和调试dev-toolsreferences/dev-tools/README.md
了解常见用法、参考实现示例samplessamples/README.md
了解安装和开发环境设置命令scriptsscripts/README.md

评论

支持 Markdown