Nextjs Server Actions Just Got Better

  Рет қаралды 10,778

Dave Gray

Dave Gray

Күн бұрын

Пікірлер: 47
@풍월상신
@풍월상신 5 ай бұрын
I hope you get well soon. Feel free to skip a week or two.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
Thanks for the kind words!
@bilimlink
@bilimlink 5 ай бұрын
Thank you for your time and efforts that poured into the video. Stay healthy
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
You're welcome!
@oladapooluwadurotimi2865
@oladapooluwadurotimi2865 5 ай бұрын
❤. Your voice sounds different today boss. Edited: get well soon sir.and be safe out there.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
Yes I've been sick. Hope to be back to normal by next week
@oladapooluwadurotimi2865
@oladapooluwadurotimi2865 5 ай бұрын
@@DaveGrayTeachesCode that's great to hear sir. Stay strong and jiggy sir. Wishing a quick recovery 🙏😊.
@codezero6023
@codezero6023 5 ай бұрын
I hope you are feeling better, Dave
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
Getting there!
@FalioV
@FalioV 5 ай бұрын
No matter of the topic, I always have something to stay with you untill the end of the video. Great content as always! :)
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
Thank you!
@abdulkarim018
@abdulkarim018 5 ай бұрын
Hope you get well soon. Your voice sounded different since the beginning of the video
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
Several days of coughing and congestion will do that. Getting better.
4 ай бұрын
Thanks Dave, this package helped me a lot, I would like to know how we can implement this for file type Inputs?
@zlackbiro
@zlackbiro 5 ай бұрын
They just going mad out there. There is a library to fix the library in js to fix next... What the fuck is wrong with those guys!? Who can follow everything about new changes everyday!!!
@allone258
@allone258 5 ай бұрын
no problem, our emotions change every day
@johnaroj
@johnaroj 5 ай бұрын
this is looking to go a bit like the trpc way of doing things
@aymenbachiri-yh2hd
@aymenbachiri-yh2hd 5 ай бұрын
Thank you so much
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
You're most welcome!
@larryblanchette3554
@larryblanchette3554 4 ай бұрын
Been trying to do some unit tests on my server actions that use next, next-safe-actions and jest. No bueno for me. I’m kinda new at this …
@Grishopping
@Grishopping 5 ай бұрын
Greetings friend thanks for the video.... Answering your question... What do you want to see in the following videos (12:50) Explanation of turborepo adding tailwind and schadcn/ui and if you can also add PRISMA or Drizzle with that we hit a home run. Greetings Jose Grillo from Venezuela
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
Thank you for the suggestions Jose!
@olehmeserenko
@olehmeserenko 5 ай бұрын
Any benefits over tanstack query? I am using server actions with useMutation from tanstack query right now, which has everything you need under the hood (error handling, loading states, etc.)
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
I think the emphasis here is on validation. This integrates well with zod or other validation libraries like valibot. I need to check the latest but last time I used React query, it wasn't handling all of this under the hood.
@olehmeserenko
@olehmeserenko 5 ай бұрын
@@DaveGrayTeachesCode Got it. Definitely recommend checking it out. Hope to see the video from you!
@shaked1233
@shaked1233 5 ай бұрын
Is there any benefits over tanstack query? If im not mistaken everything you showed is possible through use query
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
I need to check the latest on that. It is possible that TanStack is also handling server actions now. I should add the main emphasis here is the integration of Zod (or other validation if you want) so you don't have to handle all of that as I showed in the refactor. Last I checked, TanStack didn't directly integrate the validation step as shown here.
@dileepa-mn2to
@dileepa-mn2to 5 ай бұрын
Hi Dave, Im a newbie. can you exaplin why we use server actions if we are using a external API, is it make a difference with react-query and this server actions
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
An external API might take a different approach. If I'm just fetching data and not mutating it, I would fetch directly from a server component if possible.
@dileepa-mn2to
@dileepa-mn2to 5 ай бұрын
@@DaveGrayTeachesCode If we are fetching from a server component, this approach is better. am I correct?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
@@dileepa-mn2to that is preferable when possible.
@ZaibGsm
@ZaibGsm 5 ай бұрын
Dave I have a question I am having more than 2 years of exp but still I need to watch video before implementation anything new like useActionState new hook
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
Nothing wrong with that. I read docs, blogs and watch videos, too.
@ZaibGsm
@ZaibGsm 5 ай бұрын
@@DaveGrayTeachesCode oh thanks Dave 💝
@nico-y9i
@nico-y9i 5 ай бұрын
Hi Dave! I've been stuck on the trouble of having to display server error to client side. I just recently learned that in production, the server would change the error that was returned to client to a generic error message(I think this is not the issue when using action and useFormState instead of onSubmit). Should I use this on every form that uses react-hook-form and server actions? In a real world scenario, is it enough to just display a generic error message from the server? Whenever I want to do a mutation, I'm thinking of using the native form action before I switch to react-hook-form if my form is complex. Is this the right approach? Lastly, base from your experience, does it matter for UX if the error message is displayed when the form is submitted or on input blur/change.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
There should be no problems displaying an error client side using what I show in this tutorial. I am going to do a follow-up to this with a toast message tutorial. There are several patterns that can be used. It won't just display a generic server message. As shown, you also get validation errors and fetch errors. You can modify the server error to show e.message so it can be very specific. I suggest sticking with react-hook-form and showing errors onBlur. It is a much preferred user experience.
@KkrDs97
@KkrDs97 5 ай бұрын
same here, I am not able to get the error on to the client side, we can throw the generic error but returning an specific error is not working
@MarosiMate-sq2wm
@MarosiMate-sq2wm 2 ай бұрын
@@KkrDs97 Why would you do that? If you are using React Hook Form on the client side, you are already displaying errors to the user.
@BliitzPint
@BliitzPint 5 ай бұрын
Doesn't "useActionState" from React do exactly that? Why a third party hook?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
Not the same. I should have emphasized the differences more. This implements Zod or other validation and abstracts away catching errors - no try/catch necessary. Also provides clearly defined error types. I'm going to do a follow up using toasts to show some additional patterns.
@rifatmunna
@rifatmunna 5 ай бұрын
at this point i'm disappointed now can make a full e-comm website with payment and everything also learn new tech from document. thanks to you . but the sad part is i did't earn a penny even now. Maybe i miss the part where you tech how to land or get hired or earn from web dev
@MohamedElguarir
@MohamedElguarir 5 ай бұрын
that's what happens if you're in this field just for the money, instead of passion.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
Some channels focus on jobs, interviews, etc. I just focus on skills. The rest will happen if you develop skills. My top advice for getting a job is networking though. Make connections in the industry.
@mertdr
@mertdr 5 ай бұрын
You can’t even imagine how huge the difference between tutorials and real world projects. I know it might be difficult to get hired but nowadays one’s priority shouldn’t be earning money. Minimum wage or even for free, it doesn’t matter. Just start working in a company where you can learn to overcome real world obstacles.
@njosuedev.
@njosuedev. 5 ай бұрын
thank you so much
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
You're welcome!
The Problem with React Server Actions
9:45
Josh tried coding
Рет қаралды 22 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 15 МЛН
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 6 МЛН
Увеличили моцареллу для @Lorenzo.bagnati
00:48
Кушать Хочу
Рет қаралды 8 МЛН
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 94 МЛН
Next.js 15 Breakdown (Everything You Need To Know)
18:10
Web Dev Simplified
Рет қаралды 72 М.
Next.js Template vs Layout with Page Transition Animations
17:19
NextJS Parallel Routes Explained with a Simple Example
14:04
Dave Gray
Рет қаралды 14 М.
React 19's useOptimistic: EVERYTHING you NEED to know
25:24
Jack Herrington
Рет қаралды 16 М.
Go Iterators Are Bad
36:12
ThePrimeTime
Рет қаралды 105 М.
The Value of Source Code
17:46
Philomatics
Рет қаралды 202 М.
My Problem with Next.js Server Actions
10:13
James Q Quick
Рет қаралды 18 М.
Error Handling in Server Actions Next.js (Incl. Toasts!)
10:30
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 15 МЛН