How do layouts work with the router? #987
Unanswered
rahiparikh
asked this question in
Q&A
Replies: 1 comment 7 replies
-
Hello, answer a bit late, but for a future seekers will write what I found, because documentation lack about layouts mechanics. There are at least 2 options of organising folders to use layouts: Option 1:
Option 2:
So as you see we should intentionally mark which layout we want to use. Inside layouts use |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'd like to start by thanking you for building the router - it is great and super nice.
I am trying to understand how router (v1.4.2) + layouts work. If you can help me learn more, it would be great.
I have the following file-system structure:
The code in
./_layout.tsx
:The code in
./dash/_layout.tsx
:This generates the following routeTree.gen.ts.
Should the layouts in
auth
anddash
directories be configured to have their own paths or should they be treated differently?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions