next.js
31a0edbd - parallel routes: fix catch-all slots being treated as optional catch-all (#61174)

Commit
1 year ago
parallel routes: fix catch-all slots being treated as optional catch-all (#61174) ### What Catch-all parallel slots were being incorrectly matched to the root of their segment. For example, `@foo/[...catchAll]/page` as a parallel route on `/page.tsx` should not match on `/`, but it should match on `/foo`, `/bar`, ...etc ### Why The catch-all route normalization logic doesn't treat optional catch-all routes differently from catch-all routes. The assumption was if any catch-all route was found, that it should match the path that shared its prefix. ### How This updates the normalization logic to handle optional-catchall as it was in the original implementation. For regular catch-all, we ensure that the catch-all base path (for `/[...slug]` that'd be `/`) isn't identical to the path we'd match it to. Fixes #60613 Closes NEXT-2243
Author
Parents
Loading