summaryrefslogtreecommitdiff
path: root/src/hooks/useQuery.ts
blob: f025a4619ea5f525a1fc5d6c586ec6fa6d2c6b54 (plain)
1
2
3
4
5
6
7
8
9
import { useLocation } from 'react-router-dom';

const useQuery = (): Record<string, string> => {
  const location = useLocation();
  const searchParams = new URLSearchParams(location.search);
  return Object.fromEntries(searchParams);
};

export default useQuery;