Video wird geladen...
Video konnte nicht geladen werden
Form validation is hard. What if there was a Next.js form lib that does both client and server validation from one Zod schema 👀
145,943 Aufrufe • vor 2 Jahren •via X (Twitter)
8 Kommentare

Bilalvor 2 Jahren
I like the react-hook-form flow Shadcn uses. Just the client though which I think is fine.

Fredkisss is on 🦋 blue sky 🦋vor 2 Jahren
This resembles the new tanstack form, pretty sure it works on both environments exactly like that cc @crutchcorn

Danny Guerinvor 2 Jahren
I guess I'm just the weird person that really, genuinely loves writing form validation from scratch. Like, it is fun to me. Please give me more forms to validate.

Christophvor 2 Jahren
What if you need the check the db in the validation for the server only? For example to check if the selected user exists when sending the id

Michał Miszczyszyn @ yournextstore.comvor 2 Jahren
There is such library: it's called next-safe-action!

Fabian Hillervor 2 Jahren
🙌

Isaiah Marc Sanchezvor 2 Jahren
I do this with tRPC, React Hook Form and Zod

Abhinav Bharvor 2 Jahren
You can just make it a npm package and do it
