Route Group For Parallel Routes
Unanswered
Barbary Lion posted this in #help-forum
Barbary LionOP
Hey all, I am trying to use route groups to group my card components and use them in my layout, but my parallel routes for bar and foo are undefined in my layout when I try to reference them.
Here is my foder structure:
Anyone know what I am doing wrong or how I can accomplish this?
Here is my foder structure:
/root
layout.tsx // This layout reference foo and bar.
/(card) // Route group
/@bar
page.tsx
loading.tsx
/@foo
page.tsx
loading.tsxAnyone know what I am doing wrong or how I can accomplish this?
8 Replies
@Barbary Lion Hey all, I am trying to use route groups to group my card components and use them in my layout, but my parallel routes for bar and foo are undefined in my layout when I try to reference them.
Here is my foder structure:
/root
layout.tsx // This layout reference foo and bar.
/(card) // Route group
/@bar
page.tsx
loading.tsx
/@foo
page.tsx
loading.tsx
Anyone know what I am doing wrong or how I can accomplish this?
hi try to add a layout.tsx in (card) and render
@bar and @foo in app/(card)/layout.tsxBarbary LionOP
Am I able to accomplish it in the layout file below or does it have to be at the same level as the route group?
need to be same level
Barbary LionOP
Dang, I wish I could group and access the child layout. I can probably figure out how to get this to work actually.
Barbary LionOP
Hmm, that is not working. I'm not sure why.
Barbary LionOP
@Ray That did not work. It just rendered a 404 page.
/root
layout.tsx // This layout just renders the children
/(card) // Route group
layout.tsx // this layout has foo and bar
/@bar
page.tsx
loading.tsx
/@foo
page.tsx
loading.tsxBarbary LionOP
Wait, actually it works. I had something weird going on with an intercepted route
cool