Nextjs Server Actions Just Got Better

Опубликовано: 28 Декабрь 2024
на канале: Dave Gray
11,219
349

Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap

Nextjs server actions just got better with the library next-safe-action. In this video, I show the before and after code of a refactor with next-safe-action and how it helps clean up the code when using Next.js Server Actions.

💖 Support me on Patreon ➜   / davegray  

⭐ Become a full-stack web dev with Zero To Mastery Courses:
Complete Next.js Developer: https://bit.ly/CompNextJSDev
Advanced React: https://bit.ly/AdvReactDev
Junior to Senior Dev Roadmap: https://bit.ly/WebDevRoadmap-JrtoSr

🚩 Subscribe ➜ https://bit.ly/3nGHmNn

📬 Course Updates ➜ https://courses.davegray.codes/

❓ Questions - Please post them to my Discord ➜   / discord  

☕ Buy Me A Coffee ➜ https://www.buymeacoffee.com/davegray

🔗 Starter Source Code: https://github.com/gitdagray/nextjs-f...

🔗 Refactored Source Code: https://github.com/gitdagray/next-saf...

🔗 My Next.js Videos:    • Next.js Tutorials for Beginners  

👇 Follow Me On Social Media:
GitHub: https://github.com/gitdagray
Twitter:   / yesdavidgray  
LinkedIn:   / davidagray  

Nextjs Server Actions Just Got Better with next-safe-action

(00:00) next-safe-action
(00:08) Before: Original Client-Side UserForm
(01:57) After: Refactored Client-Side UserForm
(05:53) Before: Original Server Action
(07:16) After: Refactored Server Action
(09:20) Set up for the actionClient
(10:04) Possible Drawbacks
(11:48) Wrap up

📺 Video References:
🔗 Next.js Form Modal:    • Next.js Modal Form w/ React-Hook-Form...  

📚 Tutorial References:
🔗 My Blog Post: https://www.davegray.codes/posts/next...
🔗 next-safe-action: https://next-safe-action.dev/
🔗 Next.js: https://nextjs.org
🔗 Next.js Server Actions: https://nextjs.org/docs/app/building-...
🔗 Zod: https://zod.dev/

Was this tutorial about refactoring your Next.js Server Actions with next-safe-action helpful? If so, please share. Let me know your thoughts in the comments.

#nextjs #server #actions