Lesson 1.38mIntermediate16.4k students
Dynamic routes and route params
Dynamic segments capture values out of the URL and hand them to your page. Pre-generating the known ones turns a database read into a static file.
This lesson sits in Routing and Layouts, part of Next.js App Router in Depth. It assumes what came before it and leads directly into the next lesson in the module.
In this lesson you will
- Capture single, catch-all, and optional catch-all segments
- Read params and search params inside a page
- Pre-render known routes with generateStaticParams
Pro tip
Pre-generate the routes you already know about; leave the long tail to render on demand.
Resources
Your notes for this lesson will appear here.