Next.js 14 - Server Actions TUTORIAL | Type Safety, Error Handling, Pending States
HTML-код
- Опубликовано: 4 окт 2024
- Getting close to finishing the Next 14 Course, stay tuned for the update.
developedbyed....
Resources ⛏️
nextjs.org/doc...
github.com/The...
🛴 Follow me on:
Twitter: / developedbyed
Github: github.com/dev...
Dope tracks 🔥
Shofel - Balcony chll.to/8d7e18be
#react #nextjs
Thank you so much Ed for featuring next-safe-action! Very glad you find it useful.
Let me know if you want me to make a demo for optimistic updates as well 👍👍
AM YOUR BIGGEST FUN , THANK YOU GUIDANCE IN MY WEBDEV JOURNEY
please show us the way
Yes please
Yes yes yes
Yes
Hey there ED That's fantastic news! I'm really happy to hear that you found this project helpful. It's always a good idea to have server actions that prioritize type safety and error handling. I must say, the demonstrations you shared are really informative and highlight some key aspects of server actions. It's great to see that Next.js 14 is bringing in some handy features to manage loading, errors, and success. Thank you so much for sharing this valuable information!
When will your next14 course be published?❤
thank you very much ed! :) you explained it so well, now i'm getting this rocked. thanks
Rock on!
Glad to see you back! Saw you switch from tRPC to Server Actions in your repo. Is it due to the "experimental" stage of tRPC with server side calls?
Give it a shot work for heroine too, that's a double, nice shot
thanks, for introducing new packages. 👍
I hope you are well Ed
Please make a full playlist of NextJS 14~!
waiting for the course!!
Welcome back Ed!
@developedbyed I purchased your 2024 next js course. I am at the server actions example.. in your example the input of the form will clear on submit... when I click submit my input does not clear... the revalidatePath works to have it show up on the mapped Posts... except my input does NOT go blank like your input does in the example.. whats the deal with that? and what is the solution??
Amazing thank u Deved
yeah no worries! always around 👍
@@developedbyed and we are always here to see what you bring us, in Deved we trust. 😁
HE'S BAAACK!!!!!
I appreciate your videos. However, if you copy and paste content, please take the time to explain the concepts. For instance, if someone watches a video expecting to learn about server actions but instead sees Zod validation stuff, it can be confusing. It's best to align the content with the video title. Overall, I really enjoy your videos, and I think you're awesome!
thank you
AWSEMOE !!
Thanks
great one
does type-safe-zone works for server actions that integrate with api through fetch request? my backend is seperate
Make a lot next js project
My body is still ready
Any idea why I might keep getting a fetch error when using `next-safe-action` saying "TypeError: Cannot redefine property: $$id". Works fine doing a raw db.insert without next-safe-action
Can you make a video of how to do shadcn without typescript and nextjs?
You need to start using Prisma for database with postgres.
Prefer drizzle over prisma 😊
What's the benefit using server actions over API?
hello one question about min 6:15 , in my app the values look like this: type Ingredient = {
name: string;
purchasePrice: Prisma.Decimal;
}
and I'm having an error ("Only plain objects can be passed to Server Functions"), so I have to to do addIngredient(JSON.stringify(values)) in the onSubmit.
and in the definition of the action, undo by doing JSON.parse(ingredientData).
how would you deal with that without any additional package?
I've really been struggling with the prettier endlessly loading 11:08. Have you found a fix. I pruned unnecessary extensions and other things thinking there was too many extensions but it still happens often.
Sir is possible to fetch API from external in server action? I always got status code 303 even its succesed
Can you please provide the source code of last product adding form shown in this video...?
Hey I got a challange for you, (Actually I faced the same & no anyware to go 😭 😂),
Need to build a login & perform Remember me using access Token & Refresh Token which is provided by third-party backend server
Use:
Next Js (App directory: latest)
Next-Auth
SECIND ONE HERE
I'm new to nextjs, consider me dumb. Even we don't write 'use server' on top of the file , it automatically becomes a server thing? like we only need to decalre 'use client' if it's a client component, otherwise it's a server thing by default?
yes next js components are server components by default use the 'use server' when writing server actions not components server actions are just like functions which interact with the db directly without apis
Hey what's the theme name of vs code
Can you drop the repo? :)
so many packages. would prefer long(er) lines of code rather than using lots of packages. IMO.
what is the difference between this method vs using react query?
react query is used for apis and next-safe actions is used for server actions, they pretty much work the same though
@@liendwinweb dev field is a mess, glad I moved away from it. Those mf keep reinventing wheel over and over again 😅
Server actions are more advantageous right ?@@liendwin
Where is the code links?
WOW
can you sponser me two 8gb ddr4 ram vscode can keep up
Dang, so many tools I don't know 😭
8:35
Source code?
Can someone please vacuum his mic pop filter? 🤣
Can i watch it without getting drunk?
Man you are being lazy, people are waiting for your videos, including me 😅
I hope you are well Ed
thanks