We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
useQueryState
1 parent a3a11ac commit 9292f06Copy full SHA for 9292f06
client/src/hooks/useQueryState.ts
@@ -18,7 +18,8 @@ export function useQueryState<T>(
18
) {
19
function getQueryValue() {
20
const searchParams = new URLSearchParams(window.location.search);
21
- return searchParams.get(key);
+ const param = searchParams.get(key);
22
+ return param === null ? null : decodeURIComponent(param);
23
}
24
function processQueryValue(queryValue: string | null) {
25
return queryValue === null ? null : processor.fromString(queryValue);
0 commit comments