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

Поделиться
HTML-код
  • Опубликовано: 16 июн 2024
  • 🚨 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

Комментарии • 151

  • @PattyBeautCode
    @PattyBeautCode 11 месяцев назад +9

    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 🔥🔥

  • @AnindoSarker
    @AnindoSarker 11 месяцев назад +2

    Ohh my goodness this tutorial is soooo good
    I literally changed my whole career after I started watching your tutorial. Thank you 🙏

  • @bhavikshah5869
    @bhavikshah5869 11 месяцев назад +5

    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  11 месяцев назад +1

      I’m Glad it was helpful!💯💪🏽

  • @renatomignogna6895
    @renatomignogna6895 3 месяца назад +1

    Awesome explanation Sonny, straight to the point - and covers all the things I needed to know, much appreciated

  • @pranayprajapati5275
    @pranayprajapati5275 11 месяцев назад

    Nextjs just keeps getting better. Thanks sonny for keeping up with the pace.

  • @uixmat
    @uixmat 8 месяцев назад

    Love your tutorials mate, so well articulated and structured. Absolute gem 💎

  • @tunaralyarzada
    @tunaralyarzada 11 месяцев назад +2

    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 💥

  • @waggadash
    @waggadash 8 месяцев назад

    I am stunned ... so much value! Thanks a lot Sonny

  • @jacquitratongamanahaja979
    @jacquitratongamanahaja979 11 месяцев назад

    This is an epic bro, I really love your explanation as well as the way you present it. Thank you so much.

  • @karendoran3692
    @karendoran3692 11 месяцев назад

    One of the best explanations on a coding topic I have ever heard!!

  • @marioskanellopoulos8780
    @marioskanellopoulos8780 11 месяцев назад +1

    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  11 месяцев назад +1

      Thank you Mario I appreciate you!!!

  • @developerpranav
    @developerpranav 11 месяцев назад +16

    Server actions are really cool, and so are your tutorials. Would love to see one for optimistic updates!

    • @sudeshryan8707
      @sudeshryan8707 11 месяцев назад +3

      Wt is cool here? Wt problem does it solve?
      Its apparently Just a over complicated way to achieve the same thing

    • @DigitalAlchemyst
      @DigitalAlchemyst 9 месяцев назад +3

      ​@sudeshryan8707 it's all about the way it renders and speed and efficiency, you should pay attention to the video

  • @buzz.r.lightyear
    @buzz.r.lightyear 11 месяцев назад

    Super. That is exactly what I was looking for!

  • @Unghaliloruvan
    @Unghaliloruvan 11 месяцев назад +1

    u r doing awesome job bro!! we are excited to learn more advanced features in Nextjs 🤩

  • @NOTHING-en2ue
    @NOTHING-en2ue 10 месяцев назад

    i finally understand this, very great tutorial, thanks a lot ❤

  • @h_maina
    @h_maina 10 месяцев назад

    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.

  • @mikail_dev
    @mikail_dev Месяц назад

    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

  • @MrElio74
    @MrElio74 11 месяцев назад

    Thanks for doing your videos. Appreciate it

  • @peterabiodunokusolubo1541
    @peterabiodunokusolubo1541 2 месяца назад

    This is the best tutorial so far on server actions

  • @souravmehta5143
    @souravmehta5143 11 месяцев назад

    Oh bro! Was just waiting n finding this

  • @pk5388
    @pk5388 11 месяцев назад

    you video is great sonny! i'm just start learning nextjs and your video helping me a lot keep going brooo

  • @dainsleif3122
    @dainsleif3122 8 месяцев назад

    Thank you so much for explaining useTransition hook!! I didn't even know about it. That is so useful!! amazing.

  • @gowthamk5969
    @gowthamk5969 11 месяцев назад

    Thanks man . Very informative difficult to find videos on latest releases of next js & also mockup api is so cool 🥺

  • @IvoTsochev
    @IvoTsochev 11 месяцев назад

    Thanks for the video Sonny!

  • @user-vv3mn5zj2h
    @user-vv3mn5zj2h 6 месяцев назад

    Very good explaining thanks so much for this

  • @EK-rp8jp
    @EK-rp8jp 9 месяцев назад

    Omg best server action tutorial 🎉

  • @vikasni95
    @vikasni95 8 месяцев назад

    Thank you for this wonderful content 😊

  • @sicario55
    @sicario55 11 месяцев назад

    Well explained.....thorough, untangling what's in alpha shows skills 💯

  • @CodingWithTaaxo
    @CodingWithTaaxo 11 месяцев назад

    I'm really glad I watched this video

  • @salahiddinediouri280
    @salahiddinediouri280 11 месяцев назад

    this is a really cool tuto about a cool feature ( server actions ) , thank you for share it

  • @dalestewart
    @dalestewart 11 месяцев назад

    Server actions are very beneficial. It would be great to see a video on optimistic updates.

  • @blazi_0
    @blazi_0 10 месяцев назад

    Very very well done tutorial love it ❤

  • @dimasmusa221
    @dimasmusa221 9 месяцев назад

    thanks for the tutor man, this is cool

  • @tomspatula616
    @tomspatula616 3 месяца назад

    Great video !! thanks a lot

  • @hyper_channel
    @hyper_channel 6 месяцев назад

    Good video mate, coming from traditional Next, app router did bring a few new flows, quite handy.

  • @fatihcan5890
    @fatihcan5890 9 месяцев назад

    Best tutor evaa bro thanks a lot !!

  • @madhumitamiddya702
    @madhumitamiddya702 11 месяцев назад +9

    Sonny keeps his promises all the time

  • @chineducornelius6076
    @chineducornelius6076 11 месяцев назад

    Nice one Sonny, thanks 👍

  • @kyle-andrewgovinder9902
    @kyle-andrewgovinder9902 8 месяцев назад

    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

  • @Tkamsker
    @Tkamsker 11 месяцев назад

    You are a great teacher thank you

    • @SonnySangha
      @SonnySangha  11 месяцев назад +1

      Thank you! 😃 #PAPAFAM

  • @ahmedabdelgawad2684
    @ahmedabdelgawad2684 10 месяцев назад

    Good vid, Thanks

  • @beastnighttv
    @beastnighttv 11 месяцев назад

    amazing stuff!

  • @user-xz8bp5eb4d
    @user-xz8bp5eb4d 4 месяца назад

    You save me lots of time

  • @Ashish-_-
    @Ashish-_- 4 месяца назад

    Neat explanation!

  • @jeffmlb256
    @jeffmlb256 11 месяцев назад

    Sonny never disappoints ! I don't even know how to rate this level of skills

  • @umargulzar2982
    @umargulzar2982 11 месяцев назад

    Nice video totally liked it.
    Please create a full video on Next.Js any clone..

  • @deddyprianto3979
    @deddyprianto3979 11 месяцев назад

    you are hero Sony thankyou ❤

  • @programmingwithnit5308
    @programmingwithnit5308 10 месяцев назад

    Thank you brother

  • @nicocouss7849
    @nicocouss7849 11 месяцев назад

    Top thx a lot!

  • @nimanjagligovic2339
    @nimanjagligovic2339 11 месяцев назад

    Wooo let's GO ❤

  • @Nicolas0325
    @Nicolas0325 11 месяцев назад

    Thx sonny!

  • @ConorChepenik
    @ConorChepenik 10 месяцев назад

    Great video

  • @failasuf950
    @failasuf950 11 месяцев назад +1

    totally liked it. make video how to delate data plz

  • @sumitttpaul
    @sumitttpaul 11 месяцев назад +4

    Sir can you please explain about sharing data and state between server components and client components

  • @alexg7282
    @alexg7282 8 месяцев назад

    Thx !

  • @___ruthless
    @___ruthless 8 месяцев назад

    Sonny you are a g mate

  • @elmirshidev
    @elmirshidev 11 месяцев назад +1

    Nice❤

  • @fear0ne
    @fear0ne 10 месяцев назад

    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?

  • @parkerrex
    @parkerrex 11 месяцев назад

    bro perfect timing :-)

    • @SonnySangha
      @SonnySangha  11 месяцев назад

      Haha I do try!! 🙏🏽

  • @tauqeerhusain7521
    @tauqeerhusain7521 11 месяцев назад

    Biggggg love you sir ❤❤❤❤❤❤❣❣❣❣❣

  • @lakshaymanchanda2322
    @lakshaymanchanda2322 2 месяца назад

    crazy!

  • @amitsaini000
    @amitsaini000 11 месяцев назад

    awesome

  • @CoderSineNomine
    @CoderSineNomine 11 месяцев назад

    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..

  • @JohnnySalami-jo4jh
    @JohnnySalami-jo4jh 9 месяцев назад

    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?

  • @oliver1231033
    @oliver1231033 11 месяцев назад +1

    looking forward to useOptmistic and state management with server action (maybe compared to useEffect

    • @SonnySangha
      @SonnySangha  11 месяцев назад

      Awesome Il create a vid on it🔥

  • @masterv2.045
    @masterv2.045 9 месяцев назад

    you fucking rock master keep it up

  • @alexandremezeray1502
    @alexandremezeray1502 8 месяцев назад

    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?

  • @aguud
    @aguud 5 месяцев назад

    nice video

  • @noeldolan518
    @noeldolan518 6 месяцев назад

    Great video. :). BTW what tools are you using to sketch UI @ 7:38?

  • @leofaizan8886
    @leofaizan8886 Месяц назад

    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

  • @sharjilkhan7933
    @sharjilkhan7933 11 месяцев назад

    @sonny, are you using github copilot? Can you please make a video on that about your experience of using it?

  • @NeoCoding
    @NeoCoding 7 месяцев назад

    that's important things you teach ths

  • @didheemose
    @didheemose 10 месяцев назад

    This video make to me to subscribe your channel ❤

  • @mikail_dev
    @mikail_dev Месяц назад

    We would love a tutorial on useOptimistic hook.

  • @latch909
    @latch909 11 месяцев назад +5

    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

  • @learnearn8721
    @learnearn8721 11 месяцев назад

    please put a video on optimistic update video. thanks in advance

  • @davidkilamlya7630
    @davidkilamlya7630 9 месяцев назад

    Hello Sonny, can you prepare the NextJs 13.4 full course

  • @sharurocky8379
    @sharurocky8379 11 месяцев назад

    Very useful video ❤
    Can u make a redux toolkit with nextjs 13.4 videoo.....

  • @crim-son
    @crim-son 10 месяцев назад

    How do we make success feedbacks, and error messages when things go wrong?... Thanks for the tutorial ❤

  • @datamagaldadze1134
    @datamagaldadze1134 11 месяцев назад

    can you make videos about dynamic routes? api routes?

  • @dainsleif3122
    @dainsleif3122 8 месяцев назад

    Next.js got even faster.. 13.5.2 ❤

  • @piyushkapoor5195
    @piyushkapoor5195 7 месяцев назад

    @Sonny a liitle doubt - are server actions secure like can i use api keys and credentials while fetching

  • @ayushshende4290
    @ayushshende4290 10 месяцев назад

    I am new to NextJs and I am confused about the distinction between server actions and route handlers. When should we use which one?

  • @czancdy144
    @czancdy144 11 месяцев назад

    please make a video on optimistic updates

  • @agvaandanzanjargalsaikhan4820
    @agvaandanzanjargalsaikhan4820 11 месяцев назад

    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

  • @aminjafarlou8919
    @aminjafarlou8919 10 месяцев назад

    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 9 месяцев назад

      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.

  • @appstuff6565
    @appstuff6565 8 месяцев назад

    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!

  • @ajaysh73
    @ajaysh73 9 месяцев назад

    Can someone tell the extension that was suggested code most likely predictive that was used while coding? Thanks..

  • @appstuff6565
    @appstuff6565 8 месяцев назад

    note to self: @21:30 docs nextjs for different formactions even buttons can use?

  • @guled669
    @guled669 11 месяцев назад

    How do you clear the input, how to handle validations

  • @electricindro2236
    @electricindro2236 11 месяцев назад

    Please explain how useOptimistic hook works as well. Thanks for this tutorial.

    • @SonnySangha
      @SonnySangha  11 месяцев назад +1

      You got it! On the way!!

    • @electricindro2236
      @electricindro2236 11 месяцев назад

      @@SonnySangha Thanks a lot! Really appreciate it ♥️

  • @mohammadmoaid5282
    @mohammadmoaid5282 9 месяцев назад

    what about if we have a file input field in the form, how to handle it?

  • @marcogomesrd
    @marcogomesrd 11 месяцев назад

    can you make an app using DDD in the front-end side?

  • @peterabiodunokusolubo1541
    @peterabiodunokusolubo1541 Месяц назад

    Hey Sonny, what is the repo name of the above tutorial.

  • @maroofali9679
    @maroofali9679 9 месяцев назад

    Which Extention you are using for this files folder icons can you or anyone tell me ?

  • @andreyokhrimenko2271
    @andreyokhrimenko2271 11 месяцев назад +1

    Maybe in a soon feature this become game changer! Thanks a lot. In your implementation server actions - how we can clear form after submitting? I try to ask chatGPT but only one they to do it - convert form to 'use client' Isn`t it?

    • @PATILTANMAYVIJAY
      @PATILTANMAYVIJAY 10 месяцев назад

      I have Same doubt, After submitting i want to redirect to next page. How can we achieve this?

    • @andreyokhrimenko2271
      @andreyokhrimenko2271 10 месяцев назад

      I think just use useRouter from "next/navigation" google to got example @@PATILTANMAYVIJAY

  • @mathiasriissorensen6994
    @mathiasriissorensen6994 11 месяцев назад

    I’m really curious how this would work with Prisma? Especially with the tags. I’m currently using Prisma to update my database at PlanetScale.

  • @friendofyou743
    @friendofyou743 11 месяцев назад

    hey bro, small doubt how to add canonical tag for every url in next js 13

  • @alsherifkhalaf7385
    @alsherifkhalaf7385 11 месяцев назад

    what if I am fetching data with Prisma , how can i use revalidateTag ?

  • @MaKTaiL
    @MaKTaiL 10 месяцев назад

    What if I use prisma to update and fetch from my DB, how can I revalidade it?