Skip to content

Commit

Permalink
fix missing decode in useQueryState
Browse files Browse the repository at this point in the history
  • Loading branch information
tantaman committed Dec 11, 2023
1 parent a3a11ac commit 9292f06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/src/hooks/useQueryState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export function useQueryState<T>(
) {
function getQueryValue() {
const searchParams = new URLSearchParams(window.location.search);
return searchParams.get(key);
const param = searchParams.get(key);
return param === null ? null : decodeURIComponent(param);
}
function processQueryValue(queryValue: string | null) {
return queryValue === null ? null : processor.fromString(queryValue);
Expand Down

0 comments on commit 9292f06

Please sign in to comment.