Next.js Discord

Discord Forum

refresh / hard nav for parallel routes (slots)

Unanswered
Korat posted this in #help-forum
Open in Discord
KoratOP
Relatively new to NextJS, coming from Remix

I don't understand why I can't reload the page or directly access a route defined with a slot

Example:

app/(root)/@modal/profile/[username]/page.tsx

If I navigate to /profile/[username] with a <Link/> from / it works fine -> profile page.tsx is visible in the modal over the page.tsx belonging to the parent (/)

However, if I reload the page while on /profile/[username] or if I try to access it directly at e.g. http://localhost:3000/profile/[username] it only loads the modal page.tsx without the page.tsx of the parent (/). So my modal shows up on top of the layout.tsx but the / page.tsx doesn't load

I don't want to solve with intercepting the route -> that may be a fine solution for some people, but that is a different behavior than what I'm trying to achieve

Seems like this shouldn't be so difficult, but it is -> goal: refresh page takes you back to where you were

Closest thing I've found do a solution is putting the code from my page.tsx into layout.tsx but that feels hacky.

0 Replies