Back to Browse

How To Use Next.js 14 Server Actions

27.0K views
Nov 8, 2023
21:06

My fav place to learn to code is Scrimba Get 20% off a subscription with my link 👇 https://scrimba.com/?via=brettwestwood Next.js 14 has now made server actions production ready. In this video, I go over how you can implement server actions into your project so you don't have to manually create API endpoints. Server actions allow for server mutations right inside of your components. Server Actions can be defined in Server Components or called from Client Components. Defining the action in a Server Component allows the form to function without JavaScript, providing progressive enhancement. Join my FREE Discord to talk and network about web development! 👇 https://discord.gg/rKXNDnE32N TimeStamps 0:00 Intro 1:18 The Old Way of Server Mutations 4:07 Server Actions in Server Components 7:25 Revalidate Path 9:17 Client Component Server Actions 15:53 Reset the form 17:30 Loading State (useFormStatus Hook) 20:43 Outro

Download

0 formats

No download links available.

How To Use Next.js 14 Server Actions | NatokHD