Parallel Routes with a sub page
Answered
Sun bear posted this in #help-forum
Sun bearOP
I have the following routes:
/partners
/partners/nextjs
The first route
Now when I go to
I have attached an image of the structure. Is this not possible?
/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?
Answered by American black bear
and try to add a default.tsx https://nextjs.org/docs/app/building-your-application/routing/parallel-routes#defaultjs
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 showsAmerican black bear
does it show when you reload a second time?
American black bear
and try to add a default.tsx https://nextjs.org/docs/app/building-your-application/routing/parallel-routes#defaultjs
Answer
Sun bearOP
Well so I navigate to
Then a click a
When I click the browser reload, then I see a not found page
/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 🙂