hook to grab query parameters from react router

This commit is contained in:
dannyrb 2020-05-07 14:03:27 -04:00 committed by James A. Petts
parent f54fa4cb34
commit 91a3c93985
2 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1,3 @@
import useQuery from './useQuery.js';
export { useQuery };

View File

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