Перейти к содержимому

5 Server Action Mistakes That Ruin Your Next.js App ❌

Coding in Flow

0:00 / 0:00

5 Server Action Mistakes That Ruin Your Next.js App ❌

8 293 просмотра · 1 год назад
Coding in Flow
290 тыс. подписчиков
8 293 просмотра · 1 год назад
Are you making these 5 common mistakes when using server actions in Next.js/React 19? If yes, your app might have security holes and bugs. Starting code: https://github.com/codinginflow/serve... Final code: https://github.com/codinginflow/serve... ⭐ Get my full-stack Next.js with Express & TypeScript course: https://codinginflow.com/nextjs ✅ Get my free React Best Practices course: https://www.codinginflow.com/reactbes... 💌 Join my newsletter for regular web dev tips: https://codinginflow.com/newsletter 💬 Join our developer community on Discord: https://codinginflow.com/discord 📣 Follow Coding in Flow on social media: Twitter:   / codinginflow   Instagram:   / codinginflow   TikTok:   / codinginflow   Facebook:   / codinginflow   Timestamps: 0:00 - Introduction 0:51 - Sample code 2:06 - Mistake 1: Not wrapping client-side server action calls into transitions (useTransition, revalidatePath) 9:27 - Mistake 2: Not validating the user input server-side (Zod) 14:49 - Mistake 3: Not authenticating the user server-side 16:17 - Mistake 4: Not returning errors correctly 21:35 - useActionState 23:40 - Mistake 5: Using server actions to fetch data (GET request)