Different layouts for index and custom route with app router
Unanswered
American Shorthair posted this in #help-forum
American ShorthairOP
Hi. Let's say I have an index page and route /dashboard, I want to have different layouts for both of these. If I understand correctly, to have a layout for index page, I'd have to use layout.tsx in app directory and for /dashboard I'd have to use /dashboard/layout.tsx, problem is, the root layout, the one that I'd use for index, the root layout, would also apply to dashboard according to documentation. How can I have a custom non-root layout for index? Thanks.
4 Replies
check route groups
we have a "mainLayout" just for privacy/account management pages