How to avoid route conflict?
Unanswered
Sumon Chandra posted this in #help-forum
I am using NextJS 14.1.4 and I have a dynamic route within the
I want something like this- when I click the
properties route. Beside this dynamic route, there has another route which is add . When I click the add property button to navigate the /add route it give me error. Since I've implement the dynamic route so the /add route becomes a dynamic route.I want something like this- when I click the
add property button I want to navigate to the /add route. And when I click any of the properties then I want to navigate to the dynamic routes.2 Replies
@Sumon Chandra I am using NextJS 14.1.4 and I have a dynamic route within the properties route. Beside this dynamic route, there has another route which is add . When I click the add property button to navigate the /add route it give me error. Since I've implement the dynamic route so the /add route becomes a dynamic route.
I want something like this- when I click the add property button I want to navigate to the /add route. And when I click any of the properties then I want to navigate to the dynamic routes.
/add route shouldnt become a dynamic route. Next.js will prioritize static routes over add route. If you access /user/properties/add, then it will go tot he /add/page.tsx. If you access
/user/properties/asdf0sadf-asdf then it will go to the /[id]/page.tsx@ᴉuɐpɹɐɐ Got it! The error is not showing because of the dynamic route. Because of the
What can I do to avoid this?
intercepting route. If you look at my files, there is a parallel route @model . When I click the add property button to navigate to the add route, it hits the intercepting route. What can I do to avoid this?