Sequence NODE_215
MediumCreate a Catch-All Route
Next.js
React
JavaScript
Technical Specification
Create a catch-all route that matches any nested path segments and prints them.
Input/Output Samples
Input:/docs/guide/getting-started
Output:['docs','guide','getting-started']
Optimal Logic Path
// app/docs/[...slug]/page.tsx
export default function DocsPage({ params }) {
return <pre>{JSON.stringify(params.slug)}</pre>;
}Architectural Deep-Dive
Catch-all routes are useful for docs, slugs, or any arbitrary depth URL patterns.