Load the page containing the intercepted route when directly navigating to it
Unanswered
Lê Duy Quang posted this in #help-forum
Is it indeed impossible to make it so that when an intercepted route is accessed directly, the containing page that would intercept that route is displayed instead of Next.js attempting to load the corresponding standalone page?
4 Replies
Toyger
tbh I don't understand what you're trying to do
Say route
/main intercepts /main/modal and displays a modal, I want /main/modal when accessed directly to display the /main page and show the modal.Currently Next.js attempts to find a page at
/main/modal and would throw 404 if there isn't such a standalone page.@Lê Duy Quang Say route `/main` intercepts `/main/modal` and displays a modal, I want `/main/modal` when accessed directly to display the `/main` page and show the modal.
Toyger
it's kinda specific feature, I saw it pretty rarely anywhere at all.
So I suppose the only way it's make subroute that will be a copy of main with code for modal in it, theoretically it will not re-render whole page if DOM trees will be identical.
So I suppose the only way it's make subroute that will be a copy of main with code for modal in it, theoretically it will not re-render whole page if DOM trees will be identical.