Replies: 1 comment
-
For anyone facing this issue, adding the generic inference directly to the const formMethods = useForm<TCompanyBankFilter>({
resolver: zodResolver(companyBankFilterSchema),
defaultValues: INITIAL_FILTER,
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear..
Im grateful this awesome library existed. It helps me a lot with may daily life as a coder. However, as a normal Human that always want to try new thing, I come to a simple experiment once the new zod v4 beta is arrived. No user of this awesome library can deny how good these two work with eachother.
During this simple experiment, I notice something like this:
the useForm hook init:
here is my schema using the new zod v4 beta
and here is my handleSubmit:
here we can see the data returned by the handleSubmit is of type
unknown
, whereas in zod v3 it was correctly infered based on the shape of the schema.Im not really sure is this specific to React Hook Form or related to the Hook Form Resolver package. but i think it will be useful to address it here...
Thank you so much ..
Beta Was this translation helpful? Give feedback.
All reactions