Skip to content

Commit 99baa51

Browse files
committed
fix #270 - reactive tracking in set
1 parent d0695a7 commit 99baa51

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/routing.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ export const useSearchParams = <T extends Params>(): [
104104
const location = useLocation();
105105
const navigate = useNavigate();
106106
const setSearchParams = (params: SetParams, options?: Partial<NavigateOptions>) => {
107-
const searchString = untrack(() => mergeSearchString(location.search, params));
108-
navigate(location.pathname + searchString + location.hash, {
107+
const searchString = untrack(
108+
() => location.pathname + mergeSearchString(location.search, params) + location.hash
109+
);
110+
navigate(searchString, {
109111
scroll: false,
110112
resolve: false,
111113
...options

0 commit comments

Comments
 (0)