Replies: 3 comments 9 replies
-
i also find the name pathless confusing becuase it's misleading. it is pathless only when there is a matching index so the url of the index route can overwrite the pathless route's url. in a case when there is no index route the pathless route is not pathless anymore. example with pathless routein this example i don't want to have an index route, so i create a pathless wrapper and two named routes only. it is true that i don't see the content of the wrapper component on the problems:
generated
|
Beta Was this translation helpful? Give feedback.
-
@gex why you neeed to create an index route component if you are already created a wrapper route compnent? you can do the same thing what you do in index component to the wrapper component. |
Beta Was this translation helpful? Give feedback.
-
I am confused how child routes and layout routes work with TanStack Router. The docs show examples for "layout routes" but then calls the syntax that enables them (_ prefix) "pathless routes".
Child Routes
How is the parent route determined? There is inconsistent behavior when using file based routing and directories:
I have two components, one Parent and one Child. The Child should be rendered through the Paren't Outlet as a "child route".
Dot notation file structure works as expected:
But if you switch to directories, the behavior is not consistent:
UPDATE: This is intentional, the fix is to have this structure:
Layout Routes
They aren't really "layout routes" as they cannot be nested. They are "pathless routes" which I find to be extremely confusing.
Given this file structure:
Beta Was this translation helpful? Give feedback.
All reactions