Hi guys, I'm just starting with zod. I'm trying to use it with react-hook-form but I can't figure out the types. there is a type error when I use zodResolver
title: z.string(),
report: z.string().optional(),
});
type TCreateRecordSchema = z.infer<typeof CreateRecordSchema>;
export default function CreateRecordForm() {
const {
register,
handleSubmit,
formState: { errors, isSubmitting },
reset,
} = useForm<TCreateRecordSchema>({
resolver: zodResolver(CreateRecordSchema),
});```
This is the error
```Argument of type 'ZodObject<{ title: ZodString; report: ZodOptional<ZodString>; }, "strip", ZodTypeAny, { title: string; report?: string | undefined; }, { title: string; report?: string | undefined; }>' is not assignable to parameter of type 'ZodType<any, any, any>'.
The types of 'refine(...)._def.typeName' are incompatible between these types.
Type 'import("E:/myWeb_yearly/1402/06.23_upload-form/node_modules/.pnpm/[email protected]/node_modules/zod/lib/types").ZodFirstPartyTypeKind.ZodEffects' is not assignable to type 'Zod.ZodFirstPartyTypeKind.ZodEffects'.
Property 'ZodReadonly' is missing in type 'Zod.ZodFirstPartyTypeKind'.ts(2345)```
and you can check my repo from here
https://github.com/rezarahem/record-app/blob/main/components/record-form/CreateRecordForm.tsx
I add photo that shows the error
thanks