Validate Data With Zod in Server Actions Next.js (Client-Side + Server-Side)

  Рет қаралды 20,041

ByteGrad

ByteGrad

11 ай бұрын

👉 NEW React & Next.js Course: bytegrad.com/courses/professi...
Hi, I'm Wesley. I'm a brand ambassador for Kinde (paid sponsorship).
👉 Add authentication to your app FAST: bit.ly/3QOe1Bh
👉 NEW React & Next.js Course: bytegrad.com/courses/professi...
👉 Professional JavaScript Course: bytegrad.com/courses/professi...
👉 Professional CSS Course: bytegrad.com/courses/professi...
👉 Discord: all my courses have a private Discord where I actively participate
🔔 Email newsletter (BIG update soon): email.bytegrad.com
⏱️ Timestamps:
0:00 Solution
#webdevelopment #programming #coding

Пікірлер: 23
@snivels
@snivels 10 ай бұрын
Exceptionally well explained. Great video!
@hamzamellahi120
@hamzamellahi120 9 ай бұрын
love your videos, please make more!
@meka4996
@meka4996 9 ай бұрын
This is so amazing!!! This is much easier than React Hook Form + Zod! Thanks
@mukulsinghbisht2434
@mukulsinghbisht2434 2 ай бұрын
React hook form has its own advantages
@codiwebcat
@codiwebcat 7 ай бұрын
Fantastic video and all your content!
@psyferinc.3573
@psyferinc.3573 9 ай бұрын
thanks looking for a zod tutorial now
@MuhamadAzizPrasetyo
@MuhamadAzizPrasetyo 13 күн бұрын
Thank you ☺☺
@ajlmusic
@ajlmusic 5 ай бұрын
Excellent!
@wingy3181
@wingy3181 9 ай бұрын
Question: do you think the revalidation of the mutated data should be decoupled from the server action? that is, i notice that revalidatePath("/todos") is inside the server action....which means it couples the path to the server action....
@BuryneJoel
@BuryneJoel 11 ай бұрын
Thank you sir
@writterpanditsid5048
@writterpanditsid5048 5 ай бұрын
Thanks
@jeromealtariba7339
@jeromealtariba7339 5 ай бұрын
Hi, this is a nice video, however, when using actions (on not the onSubmit prop of the form), the client side validation is not triggerring at all. Only the server side validation is displayed.
@lrnngman2942
@lrnngman2942 9 ай бұрын
Can I use React hook form with Zod? or should using only 1way?
@user-xp6gm2bz8w
@user-xp6gm2bz8w 24 күн бұрын
Try my library too, multiform-validator
@eSeMGie
@eSeMGie Ай бұрын
Great wideo! That's exactly what I was looking for. I have a question though. Why do we need validation on the client and server side? It seems to be redundant. Is any possible way to pass validation one the client side and fail validation one the server side? We actually passed already validated data to the server.
@WebDevNiko
@WebDevNiko Ай бұрын
client side validation is used to give normal user feedback if validation fails but you want also server side validation before pushing the data to database etc since client side isnt to be trusted as its easyer to modify and pass the validation if you would want to do that
@eSeMGie
@eSeMGie Ай бұрын
@@WebDevNiko Big thanks for clarification!
@eSeMGie
@eSeMGie Ай бұрын
@@WebDevNiko I wonder, why we can't just make a validation on the server side, and then if validation failed return all error messages to client and give the user feedback?
@WebDevNiko
@WebDevNiko Ай бұрын
@@eSeMGie you could do that but having extra validation on client side prevents sending unnecessary requests to server side, eg every time user forget to type last name you wont send request to server. Basically its just more efficent to have validation both on client and server side especially with zod since u can reuse the schema easyly so its effortless
@swdotdev
@swdotdev 4 ай бұрын
Well the only problem with zod is that it makes large scale apps significantly slower. Other than that, yea it is great for sure.
@user-xq2pi3bu4y
@user-xq2pi3bu4y 9 ай бұрын
you got great videos, but it is so hard to follow you as you speak too fast. thx
@celsopires1999
@celsopires1999 8 ай бұрын
you can reduce the video speed if it too fast for you
@sskular
@sskular 8 ай бұрын
I actually love how snappy it is, to the point You can reduce speed and I sometimes rewind and/or pause when I feel I need a better look at a particular part of the video
React Hook Form (+ Zod) - Complete Tutorial
31:21
ByteGrad
Рет қаралды 83 М.
Неприятная Встреча На Мосту - Полярная звезда #shorts
00:59
Полярная звезда - Kuzey Yıldızı
Рет қаралды 7 МЛН
WHO DO I LOVE MOST?
00:22
dednahype
Рет қаралды 75 МЛН
The joker's house has been invaded by a pseudo-human#joker #shorts
00:39
Untitled Joker
Рет қаралды 10 МЛН
The problem with server actions
16:32
Ben Holmes
Рет қаралды 19 М.
My Problem with Next.js Server Actions
10:13
James Q Quick
Рет қаралды 15 М.
Fetching Data Doesn't Get Better Than This
6:58
Josh tried coding
Рет қаралды 83 М.
Zod Makes TypeScript Even Better
7:14
Web Dev Simplified
Рет қаралды 152 М.
The BEST way to host Next.js websites
17:37
ByteGrad
Рет қаралды 24 М.
Why I use Zod with Server Actions
15:21
Ryan Toronto
Рет қаралды 12 М.
Error Handling in Server Actions Next.js (Incl. Toasts!)
10:30
5 Tips and Tricks To Make Your Life With Next js 14 Easier
17:11
developedbyed
Рет қаралды 31 М.