aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-04-17 15:38:40 -0700
committerAnton Tananaev <anton@traccar.org>2022-04-17 15:38:40 -0700
commitad8484a08ef7eabb41afb33a9774ba8502da1d53 (patch)
tree957204d055150ee29251b24b28a9ed1d0afe88d0 /modern/src/common
parent914f3dae0e34304eebbfaae2b7740e53206ce527 (diff)
downloadtrackermap-web-ad8484a08ef7eabb41afb33a9774ba8502da1d53.tar.gz
trackermap-web-ad8484a08ef7eabb41afb33a9774ba8502da1d53.tar.bz2
trackermap-web-ad8484a08ef7eabb41afb33a9774ba8502da1d53.zip
Handle query parameters
Diffstat (limited to 'modern/src/common')
-rw-r--r--modern/src/common/useQuery.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/modern/src/common/useQuery.js b/modern/src/common/useQuery.js
index 92398bf8..ed3f74c1 100644
--- a/modern/src/common/useQuery.js
+++ b/modern/src/common/useQuery.js
@@ -1,3 +1,7 @@
+import { useMemo } from 'react';
import { useLocation } from 'react-router-dom';
-export default () => new URLSearchParams(useLocation().search);
+export default () => {
+ const { search } = useLocation();
+ return useMemo(() => new URLSearchParams(search), [search]);
+}