Next.js Discord

Discord Forum

parallel routing modal 404

Answered
Alex posted this in #help-forum
Open in Discord
Avatar
AlexOP
hi there, I have a page which displays a table. each row has a button which should open a modal. currently I have this folder structure:
orders
|- @modal
|  |- modal
|  |  |- default.tsx
|  |  |- page.tsx
|  |
|  |- page.tsx
|  |- default.tsx
|
|- default.tsx
|- layout.tsx
|- page.tsx
|- table.tsx


i just created all these default.tsx files, because I just wanted to make sure the problem is not that they are missing. table.tsx is just the table component. in the layout I am getting modal as prop and display it. now when the button in the table is clicked, it redirects from /orders to /orders/modal which should just display the current page with the table but the modal should be on top. what it actually does, is giving me a 404. What am I doing wrong?
Answered by Alex
I literally did nothing and suddenly it worked
View full answer

5 Replies

Avatar
Ray
I think you want intercepting routes?
orders/@modal/(.)modal/page.tsx
Avatar
AlexOP
but why do I need that? because with intercepting routes the docs say this: when navigated in the app, it opens a modal, but on full refresh it's a full page and not just a modal
Avatar
Ray
i dont know, I don't understand what you are trying to do
Avatar
AlexOP
I did look at the nextgram example. there you can click a photo and it opens a modal with th photo and changes the url to /photo/id. now when you access this url directly, the photo is shown in full screen on a new page and not as modal anymore. not the behaviour I want. I still want the modal, even when the page is accessed directly through the url
Avatar
AlexOP
I literally did nothing and suddenly it worked
Answer