T
TanStack7mo ago
ratty-blush

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

Did you find this page helpful?