mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 12:43:08 +00:00
updated to new way of checking path of route
This commit is contained in:
parent
ef82ffd217
commit
82fc9739bb
1 changed files with 2 additions and 2 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue