Repository navigation
Show/Edit dynamic routes inside catch-all router of Next.js App Router #66740
Unanswered
sheikhumar93
asked this question in
Help
Replies: 2 comments
|
You don't need a catch-all route for the category in this case. A catch-all segment such as |
0 replies
ApproachIn the App Router, a catch-all like Options:
const path = Array.isArray(slug) ? slug.join("/") : slug;If you share your folder tree, we can map the exact pattern. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
I have a Next.js app router setup like this that shows
/:category-handleand/products/:product-handlecorrectly, I need the product handle to be changed so that it shows/:category-handle/:product-handle. I have tried nesting the product folder inside[...category]folder but since its a catch all segment, it cannot show the dynamic routes inside it. I have looked through the Next.js docs and it looks like its not documented anywhere on how to achieve this. The[...category]is a catch all since there are other routes as well e.g. about, faqs etc. and without the catch all the category route throws a 404.How can this routing be achieved correctly in Next.js?
Additional information
Example
No response
All reactions