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
ratty-blushOP•7mo ago
zod schema:

ratty-blushOP•7mo ago
useForm
ratty-blushOP•7mo ago

eastern-cyan•7mo 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 seeratty-blushOP•7mo ago
Appreciate it, I don't know how to share a repro but I'll look at other posters
eastern-cyan•7mo 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 linkratty-blushOP•7mo ago
Updating a number of other packages seems to have solved this. Thank you for your attention!
eastern-cyan•7mo ago
Nice! Glad to hear
ratty-blushOP•7mo ago
You and me both, I have to go apologize to my wife. 😉
eastern-cyan•7mo ago
what?? 😂
ratty-blushOP•7mo ago
haha things we say when we're at our wits end haha.
eastern-cyan•7mo ago
Oooh haha I feel it