next.js
89ad6121 - Fix an issue parsing catchall params (#65277)

Commit
2 years ago
Fix an issue parsing catchall params (#65277) This should fix the following scenarios, - Given a page defined like `app/foo/[...bar]/page.tsx` - Given a page defined like `app/bar/[[...foo]]/page.tsx` - Given a parallel route defined like `app/@slot/[...catchall]/page.tsx` If you navigate to `/foo/bar` the `params` prop in the parallel route would be ```js params: { catchall: [ 'foo', [ 'bar' ] ] } ``` And if you navigate to `/bar/foo` the `params` prop in the parallel route would be ```js params: { catchall: [ 'bar', '[ ...foo ]' ] } ``` With the fix in place, the `params` prop in the parallel route will be, ```js params: { catchall: [ 'foo', 'bar', ] } ``` And ```js params: { catchall: [ 'bar', 'foo', ] } ``` Respectively
Author
Parents
Loading