Open Tim0401 opened 9 months ago
I'm facing the same issue with parallel routes in my application, specifically involving the routes '/orders/[id]' and '/orders/new'. I have a folder structure like '/@modal/(.)[id]/page.tsx'. When I navigate to '/orders/new' using router.push('/orders/new'), unexpectedly, the content of '/orders/(.)[id]' is rendered.
I've identified a workaround by reloading the page, but this approach comes with the drawback of losing client-side cache. Seeking a more efficient solution to ensure the correct rendering of '/orders/new' without resorting to a full page reload.
Link to the code that reproduces this issue
https://github.com/Tim0401/nextjs-intercepting-dynamic-routes
To Reproduce
/parent/new
params.id: new
is displayedCurrent vs. Expected behavior
I expected to display
new
, but gotparams.id: new
. In other words, when I accessed/parent/new
, I expected it to be routed toapp/[parentId]/(.)new/page.tsx
, but it was routed toapp/[parentId]/(.)[id]/page.tsx
.Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
App Router, Routing (next/router, next/navigation, next/link)
Additional context
This problem seems to reproduce only under nested Dynamic Routes.