T
TanStack9mo ago
genetic-orange

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

Did you find this page helpful?