Pre-render dynamic routes at build time
generateStaticParams is the App Router's equivalent of getStaticPaths. Export it from a dynamic route, return the list of params to pre-build, and Next.js generates static HTML for each at build time.
Default behavior for unknown params
Paths not in your list render on demand and get cached. Set export const dynamicParams = false to 404 unknown slugs instead.
Multi-level dynamic segments
For nested dynamic segments, return objects that fill in all segments. The function runs once at build; it doesn't have to enumerate every combination — only the ones you want pre-built.