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
Basically I want to know which route is currently active outside of <Routes/>, so I can for example change nav bar styles on specific page, currently this is hard to do correctly. So my proposed solution is to allow useMatch take RouteDefinition object so this works:
constisListRoute=useMatch(()=>'/list/*')// Matches everything and is not a correct solution// or way more complicatedconstisListRoute=useMatch(()=>'/list/')constisListAppleRoute=useMatch(()=>'/list/apple')constisListOrangeRoute=useMatch(()=>'/list/orange')constisListBananaRoute=useMatch(()=>'/list/banana')constisListRouteActive=createMemo(()=>isListRoute()&&isListAppleRoute()&&isListOrangeRoute()&&isListBananaRoute())
There might be some other way to solve this like having <Routes /> fire change event with matched route id.
The text was updated successfully, but these errors were encountered:
Basically I want to know which route is currently active outside of
<Routes/>
, so I can for example change nav bar styles on specific page, currently this is hard to do correctly. So my proposed solution is to allowuseMatch
takeRouteDefinition
object so this works:Alternative today is to use
There might be some other way to solve this like having
<Routes />
fire change event with matched route id.The text was updated successfully, but these errors were encountered: