updated to new way of checking path of route

This commit is contained in:
Maccesch 2022-03-09 03:25:40 +00:00
parent ef82ffd217
commit 82fc9739bb

View file

@ -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")