hook to grab query parameters from react router

This commit is contained in:
dannyrb authored and James A. Petts committed 2020-05-15 14:00:07 +02:00
1 parent f54fa4cb34
commit 91a3c93985
2 files changed
+8

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
import useQuery from './useQuery.js';
export { useQuery };
+5
View File
@@ -0,0 +1,5 @@
import { useLocation } from 'react-router-dom';
export default function useQuery() {
return new URLSearchParams(useLocation().search);
}