返回 Skill 列表
extension
分类: 开发与工程无需 API Key

managing-complex-forms

使用React Hook Form和Zod处理长表单的最佳实践。适用于预订、个人资料更新或行程创建。

person作者: jakexiaohubgithub

Complex Form Management

When to use this skill

  • Multi-step booking forms.
  • User profile editing.
  • Admin tour creation dashboard.

Tools

  • React Hook Form: For state and performance.
  • Zod: For schema validation.
  • Shadcn Form: For UI integration.

Workflow

  • [ ] Define Zod schema.
  • [ ] Initialize useForm with resolver.
  • [ ] Wrap components in <Form>.
  • [ ] Handle submission with Loading state.

Instructions

  • Inline Validation: Show errors immediately on blur or change.
  • UX: Use stepper for very long forms.