浏览代码

updated to new way of checking path of route

Maccesch 3 年之前
父节点
当前提交
82fc9739bb
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      packages/router/src/components/link.rs

+ 2 - 2
packages/router/src/components/link.rs

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