fix: use current pathname for create_query_signal (#1508)

This commit is contained in:
Danik Vitek 2023-08-08 03:25:22 +03:00 committed by GitHub
parent f01b982cff
commit 3a98bdb3c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,7 +51,7 @@ where
let key = key.into();
let query_map = use_query_map(cx);
let navigate = use_navigate(cx);
let route = use_route(cx);
let location = use_location(cx);
let get = create_memo(cx, {
let key = key.clone();
@ -72,7 +72,7 @@ where
}
}
let qs = new_query_map.to_query_string();
let path = route.path();
let path = location.pathname.get();
let new_url = format!("{path}{qs}");
let _ = navigate(&new_url, NavigateOptions::default());
});