Next 13 App Router - Dynamic Route
Answered
Capelin posted this in #help-forum
CapelinOP
Hi, I created a folder structure like this
But when I tried to go to
How can I go
app
| - dashboard
| - product
| - [id]
| - page.tsx
| - new
| - page.tsxBut when I tried to go to
/dashboard/product/new it routed to the dynamic route, is it possible to make the folder structure like this ?How can I go
new page10 Replies
a temporary solution could be to manually check in the [id] route and check if id query string is "new" and then just return that page
CapelinOP
yey, I'm thinking of that way. But is it has a normal way? like a solution from the framework. Or it doesn't support this feature for now :3
i remember reading that it is one of the last things that it does, but i can't find that 😠right now, so idk
as in nextjs pages it does that: https://codesandbox.io/s/shy-lake-j20v0 (a random codesnadbox i found)
@Capelin Hi, I created a folder structure like this
app
| - dashboard
| - product
| - [id]
| - page.tsx
| - new
| - page.tsx
But when I tried to go to `/dashboard/product/new` it routed to the dynamic route, is it possible to make the folder structure like this ?
How can I go `new` page
it should go to the /new/page.tsx
try removing
.next folderAnswer
and if it doesn't work try canary version and then bug report @alfon?
yeah
minimal repro repo first
@alfon try removing `.next` folder
CapelinOP
omg, solved. Thank you so much ðŸ™