원클릭으로
react-native-forms-validation
Best practices for implementing forms with React Hook Form and Zod.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Best practices for implementing forms with React Hook Form and Zod.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | React Native Forms & Validation |
| description | Best practices for implementing forms with React Hook Form and Zod. |
We use React Hook Form (RHF) and Zod to manage all form state and validation.
react-hook-form@hookform/resolvers/zodzodAlways start by defining a strict Zod schema for your form data. This provides both runtime validation and static TypeScript types.
import { z } from 'zod';
export const loginSchema = z.object({
email: z.string().email('Adresse email invalide'),
password: z.string().min(8, 'Le mot de passe doit contenir 8 caractères minimum'),
});
export type LoginFormData = z.infer<typeof loginSchema>;
Use the zodResolver to connect your schema to RHF.
import { useForm } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
const {
control,
handleSubmit,
formState: { errors },
} = useForm<LoginFormData>({
resolver: zodResolver(loginSchema),
defaultValues: { email: '', password: '' },
});
Because React Native does not use native HTML <form> tags, you must wrap all inputs in RHF's <Controller> component.
import { Controller } from 'react-hook-form';
<Controller
control={control}
name="email"
render={({ field: { onChange, onBlur, value } }) => (
<AppTextInput
onBlur={onBlur}
onChangeText={onChange}
value={value}
error={errors.email?.message}
/>
)}
/>;
[!WARNING] Do not use local
useStatefor form fields. Let React Hook Form manage the entire state to prevent unnecessary re-renders.
Mandatory rules and components for handling keyboard avoidance smoothly in the React Native app.
How to correctly handle and format protobuf Timestamp dates sent by the API Gateway to prevent "Invalid Date" issues.
Senior-level React Native architecture and patterns for Expo 54 apps.
Strict coding standards, naming conventions, file size limits, and typing rules.
Guidelines for managing server state, queries, and API clients in React Native.
Mandatory rule to never use deprecated APIs or ignore deprecation warnings.