File based pathless wrapping route in folder
I'm trying to figure out if I don't get the docs right. In the following situation with this folder structure:
the _layout.tsx gets its own route in the routetree, and hence it does not wrap index or accounts.tsx
However, if I change it to:
It correctly works. As I understand the docs, a
_layout.tsx
should correctly wrap the routes in the same folder. Basically the file-naming-based version _layoutfile.actualroute.tsx
is another convention. As for the _layout.tsx contents it's as simple as:
2 Replies
optimistic-gold•5mo ago
You can use the first example and call the layout file route.tsx
absent-sapphireOP•5mo ago
That's awesome. Is it just me who find the docs super confusing though? Especially https://tanstack.com/router/latest/docs/framework/react/routing/file-based-routing
File-Based Routing | TanStack Router React Docs
Most of the TanStack Router documentation is written for file-based routing and is intended to help you understand in more detail how to configure file-based routing and the technical details behind h...