You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am learning how to use tanstack-router, and was looking at the basic file-based example. I noticed that when navigating to layout-b, the active styles are lost in the navigation bar at the top. It seems this is because Layout is directly linking to layout-a, so when /layout-b is visited, it's no longer active.
I think this example should be improved to demonstrate how one might keep the nav link active, while still navigating to sub-routes. I suppose the way this would be done in practice is to add a layouts.tsx without the prefix, and then both layout-a and layout-b would be nested under that, right?
Or maybe I'm missing the point, and the whole idea of this section of the example is to show that prefixed layouts are not considered in the URL.
Which project does this relate to?
Router
Describe the bug
I am learning how to use tanstack-router, and was looking at the basic file-based example. I noticed that when navigating to layout-b, the active styles are lost in the navigation bar at the top. It seems this is because
Layout
is directly linking tolayout-a
, so when/layout-b
is visited, it's no longer active.I think this example should be improved to demonstrate how one might keep the nav link active, while still navigating to sub-routes. I suppose the way this would be done in practice is to add a
layouts.tsx
without the prefix, and then bothlayout-a
andlayout-b
would be nested under that, right?Or maybe I'm missing the point, and the whole idea of this section of the example is to show that prefixed layouts are not considered in the URL.
Your Example Website or App
https://tanstack.com/router/latest/docs/framework/react/examples/basic-file-based
Steps to Reproduce the Bug or Issue
Go to the example, click
Layout
, then in the page, click "Layout B". The active styles are lost from "Layout" at the top of the page.Expected behavior
I expected "Layout" to not lose its active styles.
Screenshots or Videos
No response
Platform
NA
Additional context
No response
The text was updated successfully, but these errors were encountered: