updated to new way of checking path of route
This commit is contained in:
1 parent
ef82ffd217
commit
82fc9739bb
1 file changed
+2
-2
@@ -98,8 +98,8 @@ pub fn Link<'a>(cx: Scope<'a, LinkProps<'a>>) -> Element {
|
||||
let prevent_default = if outerlink { "" } else { "onclick" };
|
||||
|
||||
let route = use_route(&cx);
|
||||
let location = route.current_location();
|
||||
let path = location.path();
|
||||
let url = route.url();
|
||||
let path = url.path();
|
||||
let active = path == cx.props.to;
|
||||
let active_class = active.then(|| {
|
||||
active_class.unwrap_or("active")
|
||||
|
||||
Reference in new issue
Block a user