Struggling to define parallel routes
Unanswered
del posted this in #help-forum
delOP
I'm struggling to define the following route structure using app router parallel routes:
main:
sidebar:
I've tried the following folder structure, but can't get sidebar to work as expected:
(inside my root layout I use routes from props as
(nothing works)
-
-
-
-
-
-
main:
/hub/settings/hub/projects/projectsidebar:
/hub/* (i need to catch /hub/settings and /hub/projects here)/projectI've tried the following folder structure, but can't get sidebar to work as expected:
(inside my root layout I use routes from props as
sidebar and main)@main/hub/projects/page.tsx@main/hub/settings/page.tsx@main/project/page.tsx(nothing works)
-
@sidebar/hub/[any_page]/page.tsx-
@sidebar/hub/default.tsx-
@sidebar/hub/page.tsx-
@sidebar/hub/not-found.tsx-
@sidebar/hub/[...]/page.tsx-
@sidebar/hub/[page].tsx1 Reply
@del I'm struggling to define the following route structure using app router parallel routes:
main:
`/hub/settings`
`/hub/projects`
`/project`
sidebar:
`/hub/*` (i need to catch `/hub/settings` and `/hub/projects` here)
`/project`
I've tried the following folder structure, but can't get sidebar to work as expected:
(inside my root layout I use routes from props as `sidebar` and `main`)
`@main/hub/projects/page.tsx`
`@main/hub/settings/page.tsx`
`@main/project/page.tsx`
(nothing works)
- `@sidebar/hub/[any_page]/page.tsx`
- `@sidebar/hub/default.tsx`
- `@sidebar/hub/page.tsx`
- `@sidebar/hub/not-found.tsx`
- `@sidebar/hub/[...]/page.tsx`
- `@sidebar/hub/[page].tsx`
have you tried this?
/hub/layout.tsx <-- render sidebar and children/hub/@sidebar/default.tsx/hub/@sidebar/projects/page.tsx/hub/@sidebar/settings/page.tsx/hub/projects/page.tsx/hub/settings/page.tsx