Correct way to infer error schema for form data #20
Unanswered
gregbrowndev
asked this question in
Q&A
Replies: 1 comment
|
What version of |
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.
Hi,
Thanks for the work on this project!
I'm struggling to understand how to work with the errors from
useFormDataschema. I want to validate aFormDataobject using Zod, but have a structured way to return thefieldErrorsandformErrorsthat you'd natively get with Zod.However, it seems that the errors the schema creates from
useFormDataand.error.flatten()isn't assignable to the usual Zod errors type that can be defined withz.inferFlattenedErrorsExample
All reactions