You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Zod automatically infers the typescript type from schema, so I declare my FieldValues like this:
But I feel like the useForm hook should be abre to infer the type, since the useForm's resolver uses the generic TFieldValues Resolver<TFieldValues, TContext>
Describe the solution you'd like
The zodResolver should automatically infer TFieldValues given a zod schema
Describe alternatives you've considered
Using useForm<z.infer<typeof schema>> but I think this is ugly
The text was updated successfully, but these errors were encountered:
resolver is a generic function to resolve validation schema results, unless this can be applied to all schema, we probably not going to make except or tight integration with any schema lib, however, you probably build your own custom resolver to achieve that instead. https://codesandbox.io/s/react-hook-form-customresoliver-v7-8mpqw
Is your feature request related to a problem? Please describe.
Zod automatically infers the typescript type from schema, so I declare my FieldValues like this:
and then:
But I feel like the useForm hook should be abre to infer the type, since the useForm's resolver uses the generic TFieldValues
Resolver<TFieldValues, TContext>
Describe the solution you'd like
The zodResolver should automatically infer TFieldValues given a zod schema
Describe alternatives you've considered
Using
useForm<z.infer<typeof schema>>
but I think this is uglyThe text was updated successfully, but these errors were encountered: