Загрузка видео...

Не удалось загрузить видео

На главную

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 просмотров • 2 лет назад •via X (Twitter)

Комментарии: 8

Фото профиля Bilal
Bilal2 лет назад

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

Фото профиля Fredkisss is on 🦋 blue sky 🦋
Fredkisss is on 🦋 blue sky 🦋2 лет назад

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

Фото профиля Danny Guerin
Danny Guerin2 лет назад

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.

Фото профиля Christoph
Christoph2 лет назад

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.com
Michał Miszczyszyn @ yournextstore.com2 лет назад

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

Фото профиля Fabian Hiller
Fabian Hiller2 лет назад

🙌

Фото профиля Isaiah Marc Sanchez
Isaiah Marc Sanchez2 лет назад

I do this with tRPC, React Hook Form and Zod

Фото профиля Abhinav Bhar
Abhinav Bhar2 лет назад

You can just make it a npm package and do it

Похожие видео