I would like to apply a specific layout to a page inside a parent folder which has its own root layout.
I have this folder structure:
src
app
(routes)
admin
users
payments
settings
example
[id]
page.tsx
layout.tsx
layout.tsx
page.tsx
api
components
page.tsx
layout.tsx
Here I would like to apply a different layout to /admin/example/:id
and even I put layout.tsx (example/[id]/layout.tsx
), it is still getting admin’s layout (admin/layout.tsx
) too.
I also looked at route grouping stuff but not really understood why I need to delete my root layout (src/app/layout.tsx
) where I put all my general providers such as clerk, upload services, etc.