Learn Next.js 13.4 Server Actions in 24 minutes (For beginners)

  Рет қаралды 65,059

Sonny Sangha

Sonny Sangha

Күн бұрын

🚨 Join my course Zero to Full Stack Hero: www.papareact.com/course
Next.js 13.4 just levelled up, bringing an important upgrade - the introduction of server actions. In this video, I will show you how to use them and why they might save you a significant amount of time and hassle by doing so!
🔴 LOOKING FOR THE CODE FROM THE BUILDS? 🛠️
links.papareact.com/github
📩 WANT TO LISTEN TO THE EXCLUSIVE PAPAFAM PLAYLIST?
Sign up for the PAPAFAM Newsletter here 👉 links.papareact.com/newsletter
👇🏻FOLLOW ME HERE:
Instagram: links.papareact.com/instagram
Facebook: links.papareact.com/facebook
LinkedIn: links.papareact.com/linkedin
Twitter: links.papareact.com/twitter
Discord: links.papareact.com/discord
💰 WANT TO SUPPORT THE CHANNEL?
Donate here: links.papareact.com/donate
Grab some PAPA Merch: links.papareact.com/merch
🕐 TIMESTAMPS:
00:00 Introduction
00:12 Benefits of Server Actions
00:38 Enabling Server Actions Feature
01:42 Building a Product Warehouse Example
03:16 Implementing MockAPI for the Backend
04:54 Adding an async / await function without caching
06:40 Explaining why we Need Server Actions (w/ Visuals)
08:10 Implementing a Server Action in a Server Component
11:49 Fixing the UI Update Problem with Tags
13:42 Explaining Progressive Enhancement
13:58 Explaining why Server Actions are Composable
15:37 revalidateTag vs revalidatePath
16:26 Implementing a Server Action in a Client Component
20:26 Adding multiple Server Actions
21:27 Explaining why startTransition disables Progressive Enhancement
23:09 Quick brief on useOptimistic Hook
23:53 Server Actions Summary
24:26 Outro
Let’s get it PAPAFAM 🔥.
#nextjs #reactjs #serveractions #tutorial #javascript #beginner #webdevelopment #tailwindcss

Пікірлер: 150
@PattyBeautCode
@PattyBeautCode 10 ай бұрын
Again.... Sonny has always breaking something complicate to small pieces and train us to think along side with his lessons - tutorials and give us some example so we can code better ourself later. Thanks Sonny ! Please Don't stop doing this 🔥🔥
@pranayprajapati5275
@pranayprajapati5275 10 ай бұрын
Nextjs just keeps getting better. Thanks sonny for keeping up with the pace.
@uixmat
@uixmat 7 ай бұрын
Love your tutorials mate, so well articulated and structured. Absolute gem 💎
@karendoran3692
@karendoran3692 10 ай бұрын
One of the best explanations on a coding topic I have ever heard!!
@AnindoSarker
@AnindoSarker 10 ай бұрын
Ohh my goodness this tutorial is soooo good I literally changed my whole career after I started watching your tutorial. Thank you 🙏
@waggadash
@waggadash 7 ай бұрын
I am stunned ... so much value! Thanks a lot Sonny
@renatomignogna6895
@renatomignogna6895 2 ай бұрын
Awesome explanation Sonny, straight to the point - and covers all the things I needed to know, much appreciated
@jacquitratongamanahaja979
@jacquitratongamanahaja979 10 ай бұрын
This is an epic bro, I really love your explanation as well as the way you present it. Thank you so much.
@Unghaliloruvan
@Unghaliloruvan 10 ай бұрын
u r doing awesome job bro!! we are excited to learn more advanced features in Nextjs 🤩
@tunaralyarzada
@tunaralyarzada 10 ай бұрын
Very huge Thank you, man! That's literally the tutorial that i has been looking for! For next tutorials, I would ask you to make a video about "Caching" in details (Both CDN and Client-side caching) in Next js 13 💥
@NOTHING-en2ue
@NOTHING-en2ue 9 ай бұрын
i finally understand this, very great tutorial, thanks a lot ❤
@buzz.r.lightyear
@buzz.r.lightyear 10 ай бұрын
Super. That is exactly what I was looking for!
@blazi_0
@blazi_0 9 ай бұрын
Very very well done tutorial love it ❤
@dimasmusa221
@dimasmusa221 8 ай бұрын
thanks for the tutor man, this is cool
@vikasni95
@vikasni95 7 ай бұрын
Thank you for this wonderful content 😊
@EK-rp8jp
@EK-rp8jp 8 ай бұрын
Omg best server action tutorial 🎉
@MrElio74
@MrElio74 10 ай бұрын
Thanks for doing your videos. Appreciate it
@peterabiodunokusolubo1541
@peterabiodunokusolubo1541 Ай бұрын
This is the best tutorial so far on server actions
@fatihcan5890
@fatihcan5890 8 ай бұрын
Best tutor evaa bro thanks a lot !!
@bhavikshah5869
@bhavikshah5869 10 ай бұрын
Learning server actions from your video was so much easier than diving into the docs. Thanks Sonny! Looking forward to the caching and optimistic update videos!
@SonnySangha
@SonnySangha 10 ай бұрын
I’m Glad it was helpful!💯💪🏽
@IvoTsochev
@IvoTsochev 10 ай бұрын
Thanks for the video Sonny!
@mikail_dev
@mikail_dev 21 күн бұрын
Thank you very much. I was struggling with the data refetch concept. and even though I have no knowledge in typescript you explained it very well. Thanks again
@souravmehta5143
@souravmehta5143 10 ай бұрын
Oh bro! Was just waiting n finding this
@user-vv3mn5zj2h
@user-vv3mn5zj2h 5 ай бұрын
Very good explaining thanks so much for this
@pk5388
@pk5388 10 ай бұрын
you video is great sonny! i'm just start learning nextjs and your video helping me a lot keep going brooo
@CodingWithTaaxo
@CodingWithTaaxo 10 ай бұрын
I'm really glad I watched this video
@programmingwithnit5308
@programmingwithnit5308 9 ай бұрын
Thank you brother
@gowthamk5969
@gowthamk5969 10 ай бұрын
Thanks man . Very informative difficult to find videos on latest releases of next js & also mockup api is so cool 🥺
@marioskanellopoulos8780
@marioskanellopoulos8780 10 ай бұрын
Pretty useful and explanatory video as alwasy Sonny. You never let us down man. Papafam is the best choice I've ever made!!! Sending tons of love at your side my friend
@SonnySangha
@SonnySangha 10 ай бұрын
Thank you Mario I appreciate you!!!
@dainsleif3122
@dainsleif3122 7 ай бұрын
Thank you so much for explaining useTransition hook!! I didn't even know about it. That is so useful!! amazing.
@salahiddinediouri280
@salahiddinediouri280 10 ай бұрын
this is a really cool tuto about a cool feature ( server actions ) , thank you for share it
@madhumitamiddya702
@madhumitamiddya702 10 ай бұрын
Sonny keeps his promises all the time
@dalestewart
@dalestewart 10 ай бұрын
Server actions are very beneficial. It would be great to see a video on optimistic updates.
@developerpranav
@developerpranav 10 ай бұрын
Server actions are really cool, and so are your tutorials. Would love to see one for optimistic updates!
@sudeshryan8707
@sudeshryan8707 10 ай бұрын
Wt is cool here? Wt problem does it solve? Its apparently Just a over complicated way to achieve the same thing
@DigitalAlchemyst
@DigitalAlchemyst 8 ай бұрын
​@sudeshryan8707 it's all about the way it renders and speed and efficiency, you should pay attention to the video
@h_maina
@h_maina 9 ай бұрын
Sonny, Sonny, Sonny, what a man you are. You help people get jobs and also help them keep those jobs. Thanks for the great content.
@tomspatula616
@tomspatula616 2 ай бұрын
Great video !! thanks a lot
@alexg7282
@alexg7282 7 ай бұрын
Thx !
@chineducornelius6076
@chineducornelius6076 10 ай бұрын
Nice one Sonny, thanks 👍
@hyper_channel
@hyper_channel 5 ай бұрын
Good video mate, coming from traditional Next, app router did bring a few new flows, quite handy.
@user-xz8bp5eb4d
@user-xz8bp5eb4d 3 ай бұрын
You save me lots of time
@kyle-andrewgovinder9902
@kyle-andrewgovinder9902 7 ай бұрын
Left field comment, I know, but Sonny is such a catch. Brilliant, handsome, charismatic. You were heavily favored when your specs were being drawn up
@Ashish-_-
@Ashish-_- 3 ай бұрын
Neat explanation!
@deddyprianto3979
@deddyprianto3979 10 ай бұрын
you are hero Sony thankyou ❤
@nicocouss7849
@nicocouss7849 10 ай бұрын
Top thx a lot!
@Nicolas0325
@Nicolas0325 10 ай бұрын
Thx sonny!
@ahmedabdelgawad2684
@ahmedabdelgawad2684 9 ай бұрын
Good vid, Thanks
@nimanjagligovic2339
@nimanjagligovic2339 10 ай бұрын
Wooo let's GO ❤
@umargulzar2982
@umargulzar2982 10 ай бұрын
Nice video totally liked it. Please create a full video on Next.Js any clone..
@beastnighttv
@beastnighttv 10 ай бұрын
amazing stuff!
@sicario55
@sicario55 10 ай бұрын
Well explained.....thorough, untangling what's in alpha shows skills 💯
@SonnySangha
@SonnySangha 10 ай бұрын
Thank you!
@sumitpaul3263
@sumitpaul3263 10 ай бұрын
Sir can you please explain about sharing data and state between server components and client components
@fear0ne
@fear0ne 9 ай бұрын
Hi Sonny, this is a great explanation of the new server functionality, can you tell me where would i need to add this revalidateTage when am using Prisma for database interactions?
@failasuf950
@failasuf950 10 ай бұрын
totally liked it. make video how to delate data plz
@ConorChepenik
@ConorChepenik 9 ай бұрын
Great video
@___ruthless
@___ruthless 7 ай бұрын
Sonny you are a g mate
@JohnnySalami-jo4jh
@JohnnySalami-jo4jh 8 ай бұрын
It's definitely going to take some getting used to...could there be any potential pitfalls to not attaching state to the input fields and avoiding JS?
@elmirshidev
@elmirshidev 10 ай бұрын
Nice❤
@Tkamsker
@Tkamsker 10 ай бұрын
You are a great teacher thank you
@SonnySangha
@SonnySangha 10 ай бұрын
Thank you! 😃 #PAPAFAM
@CoderSineNomine
@CoderSineNomine 10 ай бұрын
Hi Sonny, great video as always. A question for you, is it a bad practice to fetch api on client components and convert them to async? still getting used to server-client logic of next js and i have big dilemma! thx..
@masterv2.045
@masterv2.045 8 ай бұрын
you fucking rock master keep it up
@jeffmlb256
@jeffmlb256 10 ай бұрын
Sonny never disappoints ! I don't even know how to rate this level of skills
@SonnySangha
@SonnySangha 10 ай бұрын
❤️💯
@tauqeerhusain7521
@tauqeerhusain7521 10 ай бұрын
Biggggg love you sir ❤❤❤❤❤❤❣❣❣❣❣
@appstuff6565
@appstuff6565 7 ай бұрын
note to self: @21:30 docs nextjs for different formactions even buttons can use?
@leofaizan8886
@leofaizan8886 14 күн бұрын
great vid as always. Can someone please explain whats the difference between revalidate tag and fetching the API again? both are same on paper. Thanks
@crim-son
@crim-son 9 ай бұрын
How do we make success feedbacks, and error messages when things go wrong?... Thanks for the tutorial ❤
@lakshaymanchanda2322
@lakshaymanchanda2322 Ай бұрын
crazy!
@alexandremezeray1502
@alexandremezeray1502 7 ай бұрын
You're great! thank you! you've gained a subscriber ;) I've got a little question. Do you think it would be possible to add new cards, for example, by listening to a kafka topic? I know there's a kafkajs library. I've managed to consume the data from a topic but I don't know how to add an element to my page based on the new kafka messages :/ I thought the use server could do the job but I don't see how. Do you have an idea?
@didheemose
@didheemose 9 ай бұрын
This video make to me to subscribe your channel ❤
@mohammadmoaid5282
@mohammadmoaid5282 8 ай бұрын
what about if we have a file input field in the form, how to handle it?
@amitsaini000
@amitsaini000 10 ай бұрын
awesome
@noeldolan518
@noeldolan518 5 ай бұрын
Great video. :). BTW what tools are you using to sketch UI @ 7:38?
@dainsleif3122
@dainsleif3122 7 ай бұрын
Next.js got even faster.. 13.5.2 ❤
@sharjilkhan7933
@sharjilkhan7933 10 ай бұрын
@sonny, are you using github copilot? Can you please make a video on that about your experience of using it?
@davidkilamlya7630
@davidkilamlya7630 8 ай бұрын
Hello Sonny, can you prepare the NextJs 13.4 full course
@ajaysh73
@ajaysh73 8 ай бұрын
Can someone tell the extension that was suggested code most likely predictive that was used while coding? Thanks..
@parkerrex
@parkerrex 10 ай бұрын
bro perfect timing :-)
@SonnySangha
@SonnySangha 10 ай бұрын
Haha I do try!! 🙏🏽
@appstuff6565
@appstuff6565 7 ай бұрын
hey sunny thanks for this! I wanted to ask how can we do a onclick on the added products so it leads us to their respective urls? Im using nextjs with supabase. Thanks!
@appstuff6565
@appstuff6565 7 ай бұрын
@22:59
@oliver1231033
@oliver1231033 10 ай бұрын
looking forward to useOptmistic and state management with server action (maybe compared to useEffect
@SonnySangha
@SonnySangha 10 ай бұрын
Awesome Il create a vid on it🔥
@piyushkapoor5195
@piyushkapoor5195 6 ай бұрын
@Sonny a liitle doubt - are server actions secure like can i use api keys and credentials while fetching
@NeoCoding
@NeoCoding 6 ай бұрын
that's important things you teach ths
@learnearn8721
@learnearn8721 10 ай бұрын
please put a video on optimistic update video. thanks in advance
@MaKTaiL
@MaKTaiL 9 ай бұрын
What if I use prisma to update and fetch from my DB, how can I revalidade it?
@mikail_dev
@mikail_dev 21 күн бұрын
We would love a tutorial on useOptimistic hook.
@sharurocky8379
@sharurocky8379 10 ай бұрын
Very useful video ❤ Can u make a redux toolkit with nextjs 13.4 videoo.....
@maroofali9679
@maroofali9679 8 ай бұрын
Which Extention you are using for this files folder icons can you or anyone tell me ?
@aguud
@aguud 4 ай бұрын
nice video
@friendofyou743
@friendofyou743 10 ай бұрын
hey bro, small doubt how to add canonical tag for every url in next js 13
@agvaandanzanjargalsaikhan4820
@agvaandanzanjargalsaikhan4820 10 ай бұрын
in my project i am using server actions with tanstack query. What is ur opinion about that? is it good way to go or not
@latch909
@latch909 10 ай бұрын
Next automatically imports the types globally if you rename 'typings.d.ts' to 'types.d.ts' so you don't have to declare type imports on each file
@BrandonFunk
@BrandonFunk 8 ай бұрын
Can anyone tell me how to make the form clear after submitting a product? Do i need to use a use effect? or router.refresh()? im not quite sure how to achieve this, thanks for any help : )
@datamagaldadze1134
@datamagaldadze1134 10 ай бұрын
can you make videos about dynamic routes? api routes?
@ayushshende4290
@ayushshende4290 9 ай бұрын
I am new to NextJs and I am confused about the distinction between server actions and route handlers. When should we use which one?
@robinsedeqi2535
@robinsedeqi2535 8 ай бұрын
I tried the same code and approach but i got nothing but an empty page. I really don't know where I have made a mistake or something is wrong
@prafullb4652
@prafullb4652 3 ай бұрын
is server actions always expect formData.? Can it be passed directly without converting to formData.? @Sonny Sangha
@darelbvcr687
@darelbvcr687 7 ай бұрын
how to do it with prisma?
@Techcabz-wh6he
@Techcabz-wh6he 10 ай бұрын
What if I have mongodb? I still need to create 'api/product ' to handle my POST request right?
@anowarulhassan5117
@anowarulhassan5117 7 ай бұрын
Hello, I got stucked to implement google adsense to my newly released nextjs 13.4(App Router) project. I tried most of the tutorials which I found on google search and youtube search and didnot found any solutions to implement google adsense. I tried many npm packages also but they didnot worked for me. Please, make a complete video tutorial on how we can implement google adsense on Nextjs 13.4(app router) without losing SSR.
@alsherifkhalaf7385
@alsherifkhalaf7385 10 ай бұрын
what if I am fetching data with Prisma , how can i use revalidateTag ?
@aminjafarlou8919
@aminjafarlou8919 9 ай бұрын
Sonny thanks so much for the amazing content ♥. I had a question about NextJS13 and did not have any luck finding a satisfying answer on the net. How can we benefit from server side rendering features when we are using a UI library like Mantine or AntD? The problem that I have is that these libraries need a provider to wrap the entire app. However, if we do this all of our content should be inside client-side pages and we simply cannot use server-side for any page. How can we handle this issue?
@pleasejustletmebeanonymous6510
@pleasejustletmebeanonymous6510 8 ай бұрын
Have you checked if that is actually the case? As far as I understand, you can use server components inside client components as long you don't directly reference it inside the client component. By that I mean, the provider will render {children} rather than . So, as long as the component that references the provider is not a client component, you can still use server components as the children passed to the provider.
@czancdy144
@czancdy144 10 ай бұрын
please make a video on optimistic updates
@SonnySangha
@SonnySangha 10 ай бұрын
You got it!
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 167 М.
Кәріс тіріма өзі ?  | Synyptas 3 | 8 серия
24:47
kak budto
Рет қаралды 1,6 МЛН
Эта Мама Испортила Гендер-Пати 😂
00:40
Глеб Рандалайнен
Рет қаралды 10 МЛН
Follow @karina-kola please 🙏🥺
00:21
Andrey Grechka
Рет қаралды 17 МЛН
ATOM Lidar annotator tutorial
6:46
Miguel Armando Riem de Oliveira
Рет қаралды 2
Next js Tutorial for Beginners | Nextjs 13 (App Router) with TypeScript
1:02:55
Programming with Mosh
Рет қаралды 491 М.
Why I don't use React-Query and tRPC in Next.js
18:58
ByteGrad
Рет қаралды 66 М.
React + Servers = Confusion
20:30
Theo - t3․gg
Рет қаралды 39 М.
NextJS Tutorial - All 12 Concepts You Need to Know
44:38
ByteGrad
Рет қаралды 213 М.
NextJS 13. Быстрый старт
40:12
Михаил Непомнящий
Рет қаралды 102 М.
INSANE OpenAI News: GPT-4o and your own AI partner
28:48
AI Search
Рет қаралды 470 М.
Кәріс тіріма өзі ?  | Synyptas 3 | 8 серия
24:47
kak budto
Рет қаралды 1,6 МЛН