Skip navigation
Form validation is hard.
0:00 / 0:43

Form validation is hard.

Alex Sidorenko

@asidorenko_35K followers

Visit on X
586 likesDownloadOriginal post

145,980 views

Form validation is hard. What if there was a Next.js form lib that does both client and server validation from one Zod schema 👀

8 Comments

Comments from the original post on X (Twitter)

  • Bilal's profile picture

    @deepwhitman

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

    10 likes

  • Fredkisss is on 🦋 blue sky 🦋's profile picture

    @fredkisss

    This resembles the new tanstack form, pretty sure it works on both environments exactly like that cc @crutchcorn

    5 likes

  • Danny Guerin's profile picture

    @DannyGuerin7

    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.

    4 likes

  • Christoph's profile picture

    @Chrizzmeister

    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

    3 likes

  • Michał Miszczyszyn @ yournextstore.com's profile picture

    @typeofweb

    There is such library: it's called next-safe-action!

    3 likes

  • Fabian Hiller's profile picture

    @FabianHiller

    🙌

    1 like

  • Isaiah Marc Sanchez's profile picture

    @isaiahmarcs

    I do this with tRPC, React Hook Form and Zod

    1 like

  • Abhinav Bhar's profile picture

    @BharAbhinav

    You can just make it a npm package and do it