Next.js · Junior · Question 29 of 75
Which route will catch /docs/a/b/c?
- ✓Correct answer:
app/docs/[...slug]/page.tsx - 2
app/docs/[slug]/page.tsx - 3
app/docs/*/page.tsx
Explanation
A catch-all segment [...slug] collects all following segments into an array. A regular [slug] matches exactly one segment. An optional catch-all [[...slug]] also matches /docs itself. Next.js doesn't support asterisks in folder names.