Next.js Discord

Discord Forum

How can I use a nested slot in a parent layout?

Unanswered
South Polar Skua posted this in #help-forum
Open in Discord
South Polar SkuaOP
Given the following directory structure

app
  [locale]
    layout.tsx
    [...segments]
      page.tsx
      @myslot
        page.tsx


I cannot access the myslot slot in layout.tsx. Is this somehow possible?

The docs say
Slots are passed as props to the shared parent layout.
which should mean the slot should be available in layout.tsx, no?

1 Reply

South Polar SkuaOP
Okay, so I haven't thought of @myslot/[...segments]/page.tsx. This works 🙂