fix(zod): update return type in zodResolver to use z.input instead of…#749
fix(zod): update return type in zodResolver to use z.input instead of…#749diegotraid wants to merge 1 commit intoreact-hook-form:devfrom diegotraid:fix-zod-type-inference
Conversation
|
Is it possible for |
That, I think, it's the main issue here.
While useForm does: |
|
At the very least, this PR will be an improvement over the current situation |
|
Waiting for react-hook-form/react-hook-form#11951 to be merged into master to provide a more correct solution to this. |
|
That PR was merged into react-hook-form’s |
|
Hi everyone, Thank you for your contributions. A PR was merged a few days ago, but the work is still ongoing. I'm currently working on RHF and resolvers to implement type inference, (Input vs. Output/Transformed Values from the schema). Unfortunately, while this PR resolves one issue, it has created another. At this point, both libraries (RHF & resolvers) need to evolve. Please keep an eye out for upcoming PRs—your reviews and feedback will be greatly appreciated. |
|
Thanks for your hard work @jorisre! |
|
Closing since this is being resolved with PR #753 |
Resolves #743
For the function zodResolver to return a type compatible with react-hook-form, it must return
Resolver<z.input<typeof schema>>instead ofResolver<z.infer<typeof schema>>.