Skip to content
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

Fix closing a modal example in parallel routes docs #61819

Merged

Conversation

ztanner
Copy link
Member

@ztanner ztanner commented Feb 8, 2024

The docs mention using a Link to close the modal, but navigating away from a slot that was active won't automatically unmount unless it matches with a new page for that slot. This is because client-side navigations don't switch slots from active -> default. Default is only used on a hard navigation.

I believe this example used to be in here but got removed, so I re-added with some extra clarity.

Closes NEXT-2405

Copy link
Member Author

ztanner commented Feb 8, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ztanner and the rest of your teammates on Graphite Graphite

@ztanner ztanner force-pushed the 02-08-Fix_closing_a_modal_example_in_parallel_routes_docs branch from 884a484 to 32297f6 Compare February 8, 2024 14:38
@ztanner ztanner marked this pull request as ready for review February 8, 2024 14:41
@ztanner ztanner requested review from a team as code owners February 8, 2024 14:41
@ztanner ztanner requested review from ismaelrumzan and StephDietz and removed request for a team February 8, 2024 14:41
@ztanner ztanner force-pushed the 02-08-Fix_closing_a_modal_example_in_parallel_routes_docs branch 5 times, most recently from aabc141 to 2d6ec54 Compare February 8, 2024 15:17
@ztanner ztanner force-pushed the 02-08-Fix_closing_a_modal_example_in_parallel_routes_docs branch from 2d6ec54 to 878acc1 Compare February 8, 2024 15:23
Copy link
Member

@samcx samcx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lfgtm:

@ztanner ztanner merged commit 13d8b14 into canary Feb 8, 2024
33 checks passed
@ztanner ztanner deleted the 02-08-Fix_closing_a_modal_example_in_parallel_routes_docs branch February 8, 2024 19:03
@TommySorensen
Copy link

@ztanner Any change you can clarify some docs for Optional catch-all routes with route groups and slots? It seems like it dosen't work as docs mentions. This was working in fx. 14.0.1

/[locale]/(checkout)/cart/page.js
/[locale]/(shop)/[[...slug]]/layout.js (returns login or slug)
/[locale]/(shop)/[[...slug]]/@login/default.js (returns null)
/[locale]/(shop)/[[...slug]]/@login/layout.js
/[locale]/(shop)/[[...slug]]/@login/page.js
/[locale]/(shop)/[[...slug]]/@slug/default.js (returns null)
/[locale]/(shop)/[[...slug]]/@slug/layout.js
/[locale]/(shop)/[[...slug]]/@slug/page.js

I also tried with this alternative version with 2 identical page files in slug folder. But that also dosen't work.

/[locale]/(checkout)/cart/page.js
/[locale]/(shop)/layout.js (returns login or slug)
/[locale]/(shop)/@login/page.js
/[locale]/(shop)/@slug/page.js
/[locale]/(shop)/@slug/[...slug]/page.js

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
created-by: Next.js team PRs by the Next.js team locked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants