aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common/util/useQuery.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/common/util/useQuery.js')
-rw-r--r--modern/src/common/util/useQuery.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/modern/src/common/util/useQuery.js b/modern/src/common/util/useQuery.js
new file mode 100644
index 00000000..f246df7c
--- /dev/null
+++ b/modern/src/common/util/useQuery.js
@@ -0,0 +1,7 @@
+import { useMemo } from 'react';
+import { useLocation } from 'react-router-dom';
+
+export default () => {
+ const { search } = useLocation();
+ return useMemo(() => new URLSearchParams(search), [search]);
+};