Nested Layouts
If I wanted a nested layout could I create another __root.tsx file within a directory. I’m coming from Next so a bit confused how layouts work. In Next layout is a reserved filename.
4 Replies
like-gold•6mo ago
did you have a look at https://tanstack.com/router/latest/docs/framework/react/routing/routing-concepts#layout-routes ?
Routing Concepts | TanStack Router React Docs
TanStack Router supports a number of powerful routing concepts that allow you to build complex and dynamic routing systems with ease. Each of these concepts is useful and powerful, and we'll dive into...
deep-jadeOP•6mo ago
Ok so if i use the outlet componeent within a layout all children of that route will have that layout? So there's no reserved word for layout routes?
multiple-amethyst•6mo ago
https://tanstack.com/router/latest/docs/framework/react/routing/routing-concepts#pathless-layout-routes
no reserved word but theres also pathless routes if you do not want the layout to be in the URL
Routing Concepts | TanStack Router React Docs
TanStack Router supports a number of powerful routing concepts that allow you to build complex and dynamic routing systems with ease. Each of these concepts is useful and powerful, and we'll dive into...
fascinating-indigo•6mo ago
if you are using file based routing in a folder if you create a route.tsx it is basically same thing as a layout.tsx in next and the folder name also appears in the URL