Next.js
The React meta-framework for production — file-system routing, Server Components, and rendering built on top of React.
24 leçons
Next.js
Commencer le coursGetting Started
- What is Next.js?Why React alone isn't enough for most apps, and what a meta-framework like Next.js adds on top of it.
- Creating a Next.js ProjectScaffolding a new app with create-next-app and a first look at what it generates.
- The App Router File SystemHow folders and special files inside app/ turn into real URLs, with no router configuration to write.
Routing & Layouts
- Nested LayoutsHow layouts stack inside each other by folder depth, and why that keeps state alive across navigations.
- Dynamic RoutesGenerating routes from data with bracketed folder names, and why params arrives as a Promise.
- Route Groups and Project OrganizationUsing (parentheses) and _underscore folders to organize routes and colocate files without changing any URLs.
- Linking and NavigationWhy next/link isn't just a styled anchor tag, and when to reach for the useRouter hook instead.
Server & Client Components
- Server vs. Client ComponentsThe mental model behind React Server Components — why every component is server-only until you say otherwise.
- Using "use client" EffectivelyWhere to place the use client boundary so you don't accidentally turn your whole app into a client bundle.
- Composing Server and Client ComponentsPassing data across the server/client boundary safely, and the patterns that keep the split from becoming awkward.
Data Fetching & Mutations
- Data Fetching in Server ComponentsFetching with async/await directly in components, and the difference between sequential and parallel requests.
- Caching and RevalidationWhy fetch isn't cached by default, and the three ways to control how long data sticks around.
- Server ActionsRunning server-side mutations directly from a component with the use server directive, no separate API route required.
- Forms with Server ActionsShowing pending state and validation errors for a Server Action using React's useActionState hook.
Rendering & Performance
- Static and Dynamic RenderingHow Next.js decides whether a route is prerendered once or rendered fresh on every request.
- generateStaticParams and Incremental Static RegenerationPre-rendering specific dynamic routes at build time, and refreshing them later without a full redeploy.
- Loading States and StreamingUsing loading.tsx and Suspense to show something useful while slow data is still on its way.
Error Handling & SEO
- Error HandlingCatching render-time crashes with error.tsx, and showing custom 404s with not-found.tsx and notFound().
- The Metadata APISetting page titles, descriptions, and social preview data with the static metadata export and generateMetadata.
- Image Optimization with next/imageWhy a plain img tag is a performance trap at scale, and what the Image component does about it automatically.
Backend Features
- Route HandlersBuilding actual API endpoints inside the App Router with route.ts and the Web Request/Response APIs.
- Proxy (formerly Middleware)Running code before a request completes to redirect, rewrite, or inspect it — and why it's now called Proxy.
- Environment VariablesKeeping secrets out of your bundle while still making the values you actually need available in the browser.