Next.js Discord

Discord Forum

How to intercept this route without intercepting all the others routes ?

Unanswered
West African Crocodile posted this in #help-forum
Open in Discord
West African CrocodileOP
Hello,

on my website the urls of the posts look like that /rand123 (same pattern as Imgur, ex : /Uadca, /ade3a, etc...) I am trying to set up a modal / intercepted for this route so I did that :

app/
  ├── [post]/
  │   └── page.js
  ├── @modal/
  │   └── (.)[post]/
  │       └── page.js
  ├── contact/
  │   └── page.js
  └── gallery/
      └── page.js


The issue is that the modal is also catching the others routes like /contact, /gallery, /tags etc.. Altough these routes are working fine without the modal (if I go directly to /contact I see the contact page).

Any idea ?

1 Reply

Giant Angora
It seems a bit odd to head modal implemented on pages level. Is there any other way to implement modal? some ideas: url based Hook, portal