-
-
Notifications
You must be signed in to change notification settings - Fork 197
Description
Version Number
"@hookform/resolvers": "^5.2.1",
Codesandbox/Expo snack
tsx nextjs
Steps to reproduce
project_data: z.coerce.date().nullish(),
when i put that in my zod then i infer then i resolve
// ✅ TypeScript Type for Form Fields
type FormData = z.infer;
const AgentVisitForm: React.FC<{
handleFormSubmit: (FormData: FormData | null) => any;
formMutation: any;
initialData?: FormData;
}> = ({ handleFormSubmit, formMutation, initialData = defaultValues }) => {
const {
handleSubmit,
control,
watch,
setValue,
formState: { errors },
} = useForm({
resolver: zodResolver(formSchema),
defaultValues: initialData,
});
Expected behaviour
resolver schema is telling me project_date is unknown
yet infer schema is telling me project_date is Date | null | undefined
so i expected the resolver schema to tell me this too Date | null | undefined
since its what i defined in my zod
What browsers are you seeing the problem on?
Chrome
Relevant log output
"@hookform/resolvers": "^5.2.1",
"next": "15.4.6",
"zod": "^4.0.17"
Code of Conduct
- I agree to follow this project's Code of Conduct