Next.js Discord

Discord Forum

Parallel Route for modal shared between 2 outer routes

Unanswered
Basset Artésien Normand posted this in #help-forum
Open in Discord
Basset Artésien NormandOP
Good Morning.
I have an app for movies and series. Often things can be shared. I am trying to see if I can share a modal between them. They have 2 separate routes and this is how it looks currently.
└── 📁(browse)
    └── old_layout.tsx
    └── 📁movies
        └── 📁@modal
            └── 📁[id]
                └── page.tsx
            └── page.tsx
        └── default.tsx
        └── layout.tsx
        └── movies.tsx
        └── page.tsx
    └── 📁series
       └── 📁@modal
            └── 📁[id]
                └── page.tsx
            └── page.tsx
        └── default.tsx
        └── layout.tsx
        └── series.tsx
        └── page.tsx

But they need their own layout.tsx
Is there anyway to get the top route : movies or series as a prop ? without having to merge movies and series together

0 Replies