Skip to content
Discussion options

You must be logged in to vote

For anyone having this issue, here is what I've learned to get this to work.

  1. If you are using parallel / intercepted routes for modals in the root layout or a layout that is shared with a lot of routes, put all the intercept routes under one parallel route. If you have multiple parallel routes, both modals will show.
@modals
   - (.)pageone
   - (.)pagetwo
pageone
pagetwo
layout.tsx
  1. Since layouts don't re-render, if you navigate back to a parent route/page, the modal will still be in the dom and will display on the page. To prevent this, an extra condition needs to be in place on the intercepted page. Thanks for the tip here @ynng3
// (.)pageone/page.tsx
"use client";
import { usePat…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@eric-mathison
Comment options

@ynng3
Comment options

@eric-mathison
Comment options

@ynng3
Comment options

Comment options

You must be logged in to vote
1 reply
@H7ioo
Comment options

Answer selected by eric-mathison
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants