-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
routerRelated to the router implementationRelated to the router implementation
Description
Specific Demand
Add the ability to let the user tell the Link
prop to provide the active_class
prop if the target's URL is within the current URL.
E.g, if the current URL is either /listings
or /listings/random/url/:something
, a Link
component of the following, will provide the active_class
:
Link {
active_within_route: true, // Probably a better name than this
active_class: "active",
target: Route::MyTarget {}
"my link text"
}
Note:
I imagine this is already possible with one of the router's hooks, however... I'm lazy.
Implement Suggestion
Add a new prop to the Link
component that determines whether it should follow the proposed behavior.
Metadata
Metadata
Assignees
Labels
routerRelated to the router implementationRelated to the router implementation