Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

All 29 Next.js Mistakes Beginners Make

ByteGrad via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to avoid the most common pitfalls in Next.js development through this comprehensive tutorial that covers 29 critical mistakes beginners frequently make. Explore fundamental concepts like proper usage of "use client" directive, understanding the distinction between server and client components, and avoiding component architecture errors. Master data fetching patterns by learning to prevent waterfall effects, properly handle route handlers, and understand when data duplication is acceptable. Dive into server actions implementation, including proper validation, protection strategies, and correct usage patterns across different component types. Understand dynamic routing complexities including params and searchParams handling, loading state management, and strategic Suspense boundary placement. Discover performance optimization techniques to maintain static rendering, proper secret management practices, and the importance of separating client and server utilities. Address common hydration errors, third-party component integration challenges, and browser API usage in Next.js applications. Each mistake is explained with practical examples and solutions to help you build more robust and efficient Next.js applications while avoiding these frequent development traps.

Syllabus

00:00 Intro
01:58 Semaphor add analytics to your Next.js app!
04:11 #1: "use client" too high
09:45 #2: Not refactoring for "use client"
10:45 #3: Thinking a component is a server component because it does not have "use client"
12:28 #4: Thinking that a server component becomes a client component if you wrap it inside a client component
17:52 #5: Using state management Context API, Zustand, Redux in server components
19:37 #6: Using ‘use server’ to create a server component
21:46 #7: Accidentally leaking sensitive data from server to client
23:01 #8: Thinking that client components only run in the client
27:53 #9: Using browser API’s e.g. localStorage incorrectly
33:08 #10: Getting hydration errors
38:43 #11: Incorrectly dealing with third-party components
42:27 #12: Using route handlers for getting data
44:28 #13: Thinking it’s a problem to get the same data in different places
48:45 #14: Getting a ‘waterfall’ effect when fetching data
53:12 #15: Submitting data to server component or route handler
59:38 #16: Getting confused when the page doesn’t reflect data mutation
1:01:43 #17: Thinking that server actions can only be used in server components
1:03:40 #18: Forgetting to validate & protect server actions
1:07:26 #19: Adding ‘use server’ to make sure something stays on the server
1:09:35 #20: Misunderstanding dynamic routes params & searchParams
1:13:12 #21: Incorrectly working with searchParams
1:19:12 #22: Forgetting to deal with loading state
1:20:35 #23: Not being granular with Suspense
1:22:53 #24: Adding Suspense in the wrong place
1:23:40 #25: Forgetting ‘key’ prop for Suspense
1:29:49 #26: Accidentally opting a page out of static rendering
1:36:10 #27: Hardcoding secrets
1:39:52 #28: Not making a distinction between client and server utils
1:42:05 #29: Using redirect in try / catch

Taught by

ByteGrad

Reviews

Start your review of All 29 Next.js Mistakes Beginners Make

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.