how to get current url in the layout route?
I have a layout route and depending on the current url i'd like to highlight my menu
2 Replies
other-emeraldOP•2y ago
Navigation | TanStack Router Docs
Everything is Relative
Believe it or not, every navigation within an app is relative, even if you aren't using explicit relative path syntax (../../somewhere). Any time a link is clicked or an imperative navigation call is made, you will always have an origin path and a destination path which means you are navigating from one route to another ...
ambitious-aqua•2y ago
Have you tried?
From there on you could match it?
If your menu is using the
<Link / component from Tanstack Router, you then get this for free, either by using activeProps or by checking for the data attribute.