-
Hello everyone, I've encountered a situation during my development with Remix and am seeking discussions and help. I have content in
In this setup, navigating to However, I'm looking for a way to achieve a slightly different routing effect:
My intention behind this design is to use a base layout for certain pages, which can be determined by the routing conventions based on file naming. Currently, if I have these two files in
Error message:
To achieve my goal, I considered passing a value through Thank you for your time and assistance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
See this: #7296 |
Beta Was this translation helpful? Give feedback.
-
As the error said, an index route can't have child routes, this is because index is always a leaf route (the last one, in this case What you need is to create a pathless layout route that can have your shared layout.
I also like to name my global layout as
The reason I do this is because the layout name will be repeated a lot so I prefer to use a short name, |
Beta Was this translation helpful? Give feedback.
As the error said, an index route can't have child routes, this is because index is always a leaf route (the last one, in this case
/
).What you need is to create a pathless layout route that can have your shared layout.
I also like to name my global layout as
_.tsx
so the folder structure would look like this: