← スキル一覧に戻る

form-validation
by jhlee0409
세상에서 가장 맛있는 사이드 프로젝트 레스토랑
⭐ 0🍴 0📅 2026年1月3日
SKILL.md
name: form-validation description: Validates forms using React Hook Form and Zod. Use when creating forms with validation, handling form state, showing error messages, or implementing multi-step forms. Includes schema patterns and Controller usage.
Form Validation Skill
Instructions
- Use React Hook Form with Zod resolver
- Set
mode: 'onChange'for real-time validation - Use Korean error messages
- Wrap inputs with
Controllercomponent
Quick Start
import { useForm, Controller } from 'react-hook-form'
import { zodResolver } from '@hookform/resolvers/zod'
import { z } from 'zod'
const schema = z.object({
name: z.string().min(2, '2자 이상 입력해주세요.'),
email: z.string().email('유효한 이메일을 입력해주세요.'),
})
type FormData = z.infer<typeof schema>
const { control, handleSubmit, formState: { errors, isValid } } = useForm<FormData>({
resolver: zodResolver(schema),
mode: 'onChange',
})
Controller Pattern
<Controller
name="title"
control={control}
render={({ field, fieldState }) => (
<input {...field} className={fieldState.error ? 'border-red-500' : ''} />
)}
/>
For complete schema patterns, input components, and Zod 4.x migration notes, see reference.md.
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です