CoachnestCoachnest
Sign InGet Started
Back to course

Next.js 16: The Complete Developer Guide

…
—
Contents
1

What's New in Next.js 16

Reading14mFree
2

Installation, CLI & Your First Project

Reading12mFree
3

Project Structure & Conventions Deep Dive

Reading16m
4

Turbopack — The New Default Bundler

Video18m
5

Configuring TypeScript, ESLint & next.config.ts

Reading14m
6

Chapter 1 — Quiz

Quiz10m
7

App Router Fundamentals

Reading16m

Dynamic Routes, Catch-Alls & Type-Safe Params

Reading14m
9

Route Groups & Parallel Routes

Reading16m
10

Intercepting Routes & Modal Patterns

Reading12m
11

Loading, Error & Not-Found UI

Reading12m
12

Chapter 2 — Routing Quiz

Quiz12m
13

Understanding the Server/Client Boundary

Reading18m
14

Choosing When to use "use client"

Reading14m
15

Composing Server & Client Components

Reading14m
16

server-only, client-only & Code Splitting

Reading12m
17

Chapter 3 — Quiz

Quiz10m
18

Fetching Data in Server Components

Reading14m
19

The Next.js 16 Cache Model

Reading16m
20

Revalidation: revalidateTag, revalidatePath & On-Demand

Reading12m
21

Cache Components — Building Reusable Cached Functions

Reading14m
22

Search Params, Cookies & Dynamic APIs

Reading12m
23

Chapter 4 — Quiz

Quiz12m
24

Server Actions From First Principles

Reading16m
25

Forms with useActionState & Progressive Enhancement

Reading14m
26

Optimistic UI with useOptimistic

Reading12m
27

Validation with Zod + Server Actions

Reading12m
28

Chapter 5 — Quiz

Quiz10m
29

Static vs Dynamic vs Streaming

Reading14m
30

generateStaticParams & Pre-Rendering Dynamic Routes

Reading12m
31

Incremental Static Regeneration (ISR)

Reading12m
32

Partial Prerendering (PPR)

Reading16m
33

Edge Runtime vs Node.js Runtime

Reading12m
34

Rendering Strategies Deep Dive

Video22m
35

Chapter 6 — Quiz

Quiz12m
36

Tailwind CSS v4 with Next.js 16

Reading14m
37

CSS Modules, Global Styles & Scoped CSS

Reading10m
38

next/image — Smart, Fast Images

Reading14m
39

Fonts, Icons & Metadata

Reading12m
40

Chapter 7 — Quiz

Quiz10m
41

Middleware Fundamentals

Reading14m
42

Sessions, JWTs & Cookies

Reading16m
43

Protecting Server Components & Server Actions

Reading12m
44

Chapter 8 — Quiz

Quiz10m
45

Prisma with Next.js — The Production Setup

Reading14m
46

Mutations: Server Actions + Database Writes

Reading12m
47

Route Handlers & REST APIs

Reading12m
48

Chapter 9 — Quiz

Quiz10m
49

Unit & Component Testing with Vitest

Reading12m
50

End-to-End Testing with Playwright

Reading14m
51

Deploying to Vercel

Reading12m
52

Self-Hosting with Docker

Reading14m
53

Production Performance Checklist

Reading12m
54

Final Assessment — Next.js 16 Mastery

Quiz20m
←→navigate lessons
Chapter 2 of 10·Chapter 2 — Routing & Navigation with the App Router
Lesson 8 of 54Reading14 min

Dynamic Routes, Catch-Alls & Type-Safe Params

#Dynamic Routes, Catch-Alls & Type-Safe Params¶

Single Dynamic Segment¶

app/users/[id]/page.tsx → /users/:id
tsx
6 lines
1export default async function UserPage({ params }: { params: Promise<{ id: string }> }) {
2  const { id } = await params;
3  const user = await db.user.findUnique({ where: { id } });
4  if (!user) notFound();
5  return <h1>{user.name}</h1>;
6}

Multiple Dynamic Segments¶

app/blog/[year]/[slug]/page.tsx → /blog/2026/hello-world
tsx
6 lines
1type Params = Promise<{ year: string; slug: string }>;
2
3export default async function Post({ params }: { params: Params }) {
4  const { year, slug } = await params;
5  // …
6}

Catch-All Segments¶

app/docs/[...path]/page.tsx → /docs/a, /docs/a/b, /docs/a/b/c

params.path is a string array:

tsx
2 lines
1const { path } = await params;
2// /docs/a/b/c  →  path = ["a", "b", "c"]

Optional Catch-All¶

Wrap the brackets: ...path. Matches both /docs (no segments) and /docs/a/b.

URLparams.path
/docsundefined
/docs/intro["intro"]
/docs/api/auth["api", "auth"]

Pre-Generating Pages with generateStaticParams¶

Tell Next which dynamic routes to prerender at build time:

tsx
8 lines
1// app/blog/[slug]/page.tsx
2export async function generateStaticParams() {
3  const posts = await db.post.findMany({ select: { slug: true } });
4  return posts.map((p) => ({ slug: p.slug }));
5}
6
7// Optionally: error on unknown slugs (no on-demand SSG)
8export const dynamicParams = false;

Generating Per-Route Metadata¶

tsx
13 lines
1import type { Metadata } from "next";
2
3export async function generateMetadata(
4  { params }: { params: Promise<{ slug: string }> }
5): Promise<Metadata> {
6  const { slug } = await params;
7  const post = await getPost(slug);
8  return {
9    title: post.title,
10    description: post.excerpt,
11    openGraph: { images: [post.coverImage] },
12  };
13}

Typed Routes for Dynamic Segments¶

With experimental.typedRoutes: true and template literals:

tsx
2 lines
1<Link href={`/blog/${post.slug}`} />   // ✅ inferred
2<Link href={`/blogs/${post.slug}`} />  // ❌ compile error

Pitfalls¶

  1. 1Forgetting await on params — TypeScript catches this; runtime error otherwise.
  2. 2Catch-all conflict — [id] and [...path] in the same folder shadow each other. Be explicit.
  3. 3Returning null from generateStaticParams — return an empty array to opt out of prerender, not null.

Previous

App Router Fundamentals

Next

Route Groups & Parallel Routes

Use ← → arrow keys to navigate between lessons