How to generate route with optional catch-all segments?
Simas06 opened this issue · 6 comments
Hello,
Can't get it to work with app router and optional catch-all segments
https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes#optional-catch-all-segments
Page example:
src/roots/category/[[...slugs]]/page.js
How should route for such page be generated with dynamic slugs?
Hi @Simas06 , thank you for pointing this out. I added support for optional catch all routes. Please update to the most recent version of next-roots package and try. I added example usage to examples/basic
Thank you, it works! Also would be great to have support for not optional catch-all segments also
For example:
src/roots/category/[...slugs]/page.js
Tried again, still not optional catch-all route generation ignores passed parameters.
Hi @Simas06, the new version 3.6.0 covers non-optional routes. See example https://github.com/svobik7/next-roots/tree/master/examples/basic/src/routes/books/%5B...slugs%5D
Could you please test on your end?
It works now, thank you!