summaryrefslogtreecommitdiff
path: root/src/hooks/useQuery.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/hooks/useQuery.ts')
-rw-r--r--src/hooks/useQuery.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/hooks/useQuery.ts b/src/hooks/useQuery.ts
new file mode 100644
index 0000000..b2cb628
--- /dev/null
+++ b/src/hooks/useQuery.ts
@@ -0,0 +1,9 @@
+import { useLocation } from 'react-router-dom';
+
+const useQuery = () => {
+ const location = useLocation();
+ const searchParams = new URLSearchParams(location.search);
+ return Object.fromEntries(searchParams);
+};
+
+export default useQuery;