New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking to the base route from an intercepted route does not clear the intercepted slot #58180
Comments
Screen.Recording.2023-12-07.at.12.47.47.PM.movSame issue here. Linking from a parallel route back to the main page we rendered it from does not work if data has been mutated and a revalidation has occurred. |
I can confirm what I believe is the same issue. Directory Structure:
Navigating: Causes the sidebar to still be shown. (And the Whether I use a As a bit of a side note:
So |
Hi @maxch-aa. If you modify your
And have the catchAll page render Here's a quick video of me making this change and testing the app: CleanShot.2024-01-10.at.14.02.21.mp4The reason for this behavior is that parallel routes (which is what route interception is built on top of), when navigating to a new route, will preserve whatever was in the slot previously when it cannot find a match on the new route. The catch-all route fixes this because when navigating back to Let me know if this doesn't make sense or you aren't able to get it to work. Will be happy to dig in further. I'll be closing this for now since this appears to be by design. |
@ztanner Thanks for your response, I was super hopeful, unfortunately this solution isn't working for me I've tested with the layout.tsx in /operations being both a client side and server side component. No dice.
Layout is super simple
|
I think I'm seeing the same behavior described in |
@ztanner I've added the catch-all route you recommended here: It makes no difference. I thought the |
I can also confirm that the latest canary build v14.0.5-canary.52 also has the same issue |
@Inlustra Could you open an issue with a reproduction? It's difficult to go off of screenshots alone, thank you! https://codesandbox.io/p/github/maxch-aa/next-intercepted-route/csb-88vlwf/draft/objective-hill |
@ztanner Just updated to the latest canary It wouldn't let me view your link, because of permissions perhaps. What changes did you make or what steps do you take? |
@maxch-aa I just bumped I revisited your sandbox and it worked for me CleanShot.2024-01-11.at.08.48.10.mp4 |
@ztanner I got it finally working by running @Inlustra The catch-all trick is mentioned here: https://nextjs.org/docs/app/building-your-application/routing/parallel-routes#dismissing-a-modal . The docs also say:
|
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Link to the code that reproduces this issue
https://codesandbox.io/p/github/maxch-aa/next-intercepted-route/main
To Reproduce
Current vs. Expected behavior
Currently the url changes to /, but the modal remains.
I expect the modal to disappear.
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023 Binaries: Node: 20.9.0 npm: 9.8.1 Yarn: 1.22.19 pnpm: 8.10.2 Relevant Packages: next: 14.0.2-canary.18 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
App Router
Additional context
Issue demo
NEXT-2039
The text was updated successfully, but these errors were encountered: