MENU

Fun & Interesting

The BEST Way to Handle Form Validation in Next.js!

Jan Marshal 4,085 2 months ago
Video Not Working? Fix It Now

Form validation has always been one of the most annoying things, in my opinion. And now, with the shift to server actions, client-side and server-side validation have never been more important. In this video, I'll show you how to implement both client and server-side form validation in Next.js. I truly believe this is the best solution out there. We’ll use tools like shadcn, Zod, React Hook Form, and more. And of course, we’ll also render toasts based on server validation. Enjoy! 📸 Screen Recording Software: https://dub.sh/eDa47SO 🔒 The best Authentication service: https://dub.sh/xeU8r3v 🚀 Checkout Cal for Free: https://dub.sh/FAuffAy 👨🏻‍💻 GitHub Repository: https://github.com/ski043/form-validation 🌍 My Website: https://janmarshal.com/ ✅ Follow me on X: https://x.com/janmarshaldev 📧 Business ONLY: [email protected] Timestamps: 00:00 Intro 00:50 Introduction to Example 02:05 “Native” Form Validation 04:00 “Custom” Form Validation 06:45 Step One: Zod Schema 09:20 Client Side Form Validation 20:00 Server Side Form Validation 24:00 Toast Notifications

Comment