Skip to content

Commit

Permalink
Hotfix for critical bugs introduced during query-string integration (#5)
Browse files Browse the repository at this point in the history
* Use query-string to (de-)serialize search params in url

* Integrate query-string

* Bump version number

* Hotfix

---------

Co-authored-by: Danila Pokhabov <danila.pokhabov@mcc-soft.de>
  • Loading branch information
realwoopee and Danila Pokhabov committed Jun 23, 2023
1 parent 8cae0c7 commit 633e495
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/useQueryParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const useQueryParams = <QPCMap extends QueryParamConfigMap>(
if (paramConfigMap) {
return decodeQueryParams(
paramConfigMap,
queryString.parse(location.search, {}) as any,
queryString.parse(location.search) as any,
);
}
return {};
Expand All @@ -64,7 +64,7 @@ export const useQueryParams = <QPCMap extends QueryParamConfigMap>(
? changes(resultRef.current as any)
: changes;
const encoded = encodeQueryParams(paramConfigMapRef.current, values);
navigate(queryString.stringify(encoded), navigateOptions);
navigate('?' + queryString.stringify(encoded), navigateOptions);
},
[navigate],
);
Expand Down

0 comments on commit 633e495

Please sign in to comment.