next.js
270a9db0 - support breadcrumb style catch-all parallel routes (#65063)

Commit
1 year ago
support breadcrumb style catch-all parallel routes (#65063) A common pattern for parallel routes is breadcrumbs. For example, if I have a lot of dynamic pages, and I want to render a parallel route that renders as a breadcrumb to enumerate those dynamic params, intuitively I'd reach for something like `app/@slot/[...allTheThings]/page.tsx`. Currently however, `[...allTheThings]` would only match params to a corresponding `app/[allTheThings]/page.tsx`. This makes it difficult to build the breadcrumbs use-case unless you re-create every single dynamic page in the parallel route as well. This adds handling to provide unmatched catch-all routes with all of the params that are known. For example, if I was on `/app/[artist]/[album]/[track]`, and I visited `/zack/greatest-hits/1`, the parallel `@slot` params would receive: `{ allTheThings: ['zack', 'greatest-hits', '1'] }` Fixes #62539 Closes NEXT-3230
Author
Parents
Loading