remix icon indicating copy to clipboard operation
remix copied to clipboard

Automated layout nesting always inheriting from root.tsx when overridden

Open Mardoxx opened this issue 8 months ago • 2 comments

Reproduction

The use case here is, user wants pages to default to using a default layout. Alternatively certain pages should use their own defined template.

Reading https://remix.run/docs/en/main/file-conventions/routes#nested-urls-without-layout-nesting it seems you should be able to override the default layouts.

https://stackblitz.com/edit/remix-run-remix-jdvbmm?file=app%2Froutes%2F_auth.loginfoo_.tsx

If you go to /login or /loginfoo both still inherit from root.tsx

Perhaps I have misunderstood.

To conceptualise, imagine all pages to require a header, besides the login and about page -- without using a conditional rendering in the root.tsx template..

System Info

See stackblitz

Used Package Manager

npm

Expected Behavior

Not to use root.tsx on overridden layout.

Actual Behavior

Uses root.tsx on overridden layout.

Mardoxx avatar May 27 '24 18:05 Mardoxx