_index.tsx layout?
am I doing something wrong or is it not possible to add layout to index.tsx using _index.tsx?
would be cool to keep the layout in the same dir as the route itself
4 Replies
optimistic-gold•8mo ago
that's not how pathless routes work in router
the only way to keep them next to each other is
put the layout into route.tsx
continuing-cyanOP•8mo ago
I don't really need it, but I think it's an interesting case, do you know how to add a layout for
/
? if I create src/routes/_index.tsx
then it creates a route with this name (/_index
)optimistic-gold•8mo ago
either put it in the root route or create a _foo layout and nest under it
eager-peach•8mo ago
To add to this, you can do
to have the layout in the same folder with the route