Replies: 4 comments 9 replies
-
@tigawanna Did you found any solution?? i'm also on the same page the code based routing is working fine but file based routing not showing the parent in background. |
Beta Was this translation helpful? Give feedback.
-
So I couldn't get this to work either as expected. This is the issue as I see it, whe using file based routes the route is defined by the file/folder structure rathar than a given path string. In the example the mask and route and configured together WITH the parent route being set. With file based routing the parent is set based on the directory structure, so in the photos example all of
I.E. have their parent set to With file based routing whilst you'd expect a folder strucure of:
matching to to work the same the relationship actually looks like:
I've got it working in my own project but there's an important bit to understand about route hierachy and how siblings and nesting is calculated which may not be obvious at first. It's important to note that unless there is a path parameter the router sees it as a sibling. My project shows a modal to create new items with the following structure:
And To then make a direct link to
This allowed this to render in the root tree not in the location tree. There might be a better way to do this as realy I'd like to keep all the files in the locations folder to maintain a clean structure but I'm not sure it's possible. Sorry not the most concise description but I was writing this whilst fixing it on my project. Hopefully it helps. @tannerlinsley If I get time i'll get an example prepared for the docs as this is a complicated thing to work out from the current examples but a common use case. |
Beta Was this translation helpful? Give feedback.
-
Hey! I ran into this too — the key is how file-based routing sets parent/child relationships by folder structure, not by route path like in code-based routing. If your modal route isn’t showing over the background page, it’s likely because the parent-child hierarchy isn’t set right. You can try this:
Yeah, it’s a bit tricky — would love better docs on this too. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Just tried out route masking with file based and it seems to work but doesn't show the modal on top of the current data like in the docs demos
Beta Was this translation helpful? Give feedback.
All reactions