Basic validation example
Having a frustrating time with the new 1.0.0 and basic validation. Maybe the documentation is not updated?
I JUST want to do this:
- when user submits form
- validate against zod schema
- if there are errors, display them under the relevant fields.
No combination of time, determination and AI assistance has led me to a working example.
I feel like this is not a fringe case. This should be so easy to do. Any working examples for this most simple of examples would be appreciated, thank you. ❤️
12 Replies
genetic-orangeOP•9mo ago
zod schema:

genetic-orangeOP•9mo ago
useForm
genetic-orangeOP•9mo ago

extended-salmon•9mo ago
Can you try
z.input instead of z.infer? IDK why that would matter tho - this is absolutely supported.
Can you share a minimal repro? I'm sure it's something small that I somehow can't seegenetic-orangeOP•9mo ago
Appreciate it, I don't know how to share a repro but I'll look at other posters
extended-salmon•9mo ago
Try: StackBlitz.com
It gives you a web version of VSCode and an IDE you can
npm i in
Then you just share the linkgenetic-orangeOP•9mo ago
Updating a number of other packages seems to have solved this. Thank you for your attention!
extended-salmon•9mo ago
Nice! Glad to hear
genetic-orangeOP•9mo ago
You and me both, I have to go apologize to my wife. 😉
extended-salmon•9mo ago
what?? 😂
genetic-orangeOP•9mo ago
haha things we say when we're at our wits end haha.
extended-salmon•9mo ago
Oooh haha I feel it