Next.js Discord

Discord Forum

Parallel Routes with a sub page

Answered
Sun bear posted this in #help-forum
Open in Discord
Sun bearOP
I have the following routes:

/partners
/partners/nextjs

The first route /partners has to layouts depending on logged in or logged out and that loads fine.
Now when I go to /partners/nextjs then I get page not found.

I have attached an image of the structure. Is this not possible?

12 Replies

American black bear
The partners/layout.tsx shoud reference when active user the params.partnersLoggedIn, when not the other
so you switch between loggedIn and loggedOut
Sun bearOP
I do already do that in that layout: {user ? partnersLoggedIn : partnersLoggedOut}
The problem is /partners/nextjs for example shows not found when i reload the page, but when i redirect client side to it it shows
American black bear
does it show when you reload a second time?
American black bear
Answer
Sun bearOP
Well so I navigate to /partners and see the logged in page.
Then a click a <Link /> there to /partners/nextjs and I see the partner nextjs page.
When I click the browser reload, then I see a not found page
yeah cool that does the trick!
thanks!
American black bear
Then you can set this as marked as resolved 🙂