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

  Рет қаралды 19,310

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 8 ай бұрын
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 6 ай бұрын
Fantastic video and all your content!
@psyferinc.3573
@psyferinc.3573 8 ай бұрын
thanks looking for a zod tutorial now
@MuhamadAzizPrasetyo
@MuhamadAzizPrasetyo 3 күн бұрын
Thank you ☺☺
@BuryneJoel
@BuryneJoel 10 ай бұрын
Thank you sir
@ajlmusic
@ajlmusic 5 ай бұрын
Excellent!
@writterpanditsid5048
@writterpanditsid5048 4 ай бұрын
Thanks
@wingy3181
@wingy3181 8 ай бұрын
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....
@lrnngman2942
@lrnngman2942 8 ай бұрын
Can I use React hook form with Zod? or should using only 1way?
@user-xp6gm2bz8w
@user-xp6gm2bz8w 14 күн бұрын
Try my library too, multiform-validator
@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.
@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 3 ай бұрын
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 8 ай бұрын
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 7 ай бұрын
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
Рет қаралды 82 М.
小女孩把路人当成离世的妈妈,太感人了.#short #angel #clown
00:53
1 класс vs 11 класс  (игрушка)
00:30
БЕРТ
Рет қаралды 3,7 МЛН
Универ. 13 лет спустя - ВСЕ СЕРИИ ПОДРЯД
9:07:11
Комедии 2023
Рет қаралды 4,7 МЛН
Fetching Data Doesn't Get Better Than This
6:58
Josh tried coding
Рет қаралды 77 М.
The 3 REAL benefits of Next.js Server Actions
12:11
ByteGrad
Рет қаралды 24 М.
Why I use Zod with Server Actions
15:21
Ryan Toronto
Рет қаралды 12 М.
My Problem with Next.js Server Actions
10:13
James Q Quick
Рет қаралды 15 М.
Next js 15 is Here… New Changes Again?!
8:13
JavaScript Mastery
Рет қаралды 109 М.
The BEST way to host Next.js websites
17:37
ByteGrad
Рет қаралды 23 М.
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 183 М.
NextJS Tutorial - All 12 Concepts You Need to Know
44:38
ByteGrad
Рет қаралды 240 М.
Next.js Server Actions...  5 awesome things you can do
7:51
Beyond Fireship
Рет қаралды 252 М.
小女孩把路人当成离世的妈妈,太感人了.#short #angel #clown
00:53