Open roksui opened 1 week ago
Can confirm this happens to my app as well, in both dev and prod.
Related, when using <Link />
to link to base of the modal, the modal still persists when it should be destroyed instead.
eg /photos/A
, then use Link
to go to /photos
, the route changes but the modal is still there.
Try duplicating default.tsx
and rename duplicated file to page.tsx
for each @modal
folder. That should clear the modal when you go back to the root of each intercepted folder.
Link to the code that reproduces this issue
https://github.com/roksui/my-nextagram
To Reproduce
npm run dev
.View my notifications
link.View photo 1
.Current vs. Expected behavior
When I press the back button in step 6 above, I expected the browser to navigate back to the intercepted route for
/notifications
. However, only the URL changes and the page stays the same, showing the intercepted route of/photos
.Provide environment information
Which area(s) are affected? (Select all that apply)
Parallel & Intercepting Routes
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
Basically my use case is to open two modals A and B, where modal B is opened from modal A. I have it structured as:
I could not find any documentation on implementing multiple intercepted routes, so not sure if this structure is the way to go.
With this structure, the intercepting works with no problems with the two modals. Also, refreshing on the first intercepting route and navigating back works too. However, refreshing on the second intercepting route and navigating back causes an issue.