import React from 'react';
import { useLocation } from 'react-router-dom';

function useQueryParams() {
  const { search } = useLocation();
  return React.useMemo(() => Object.fromEntries(new URLSearchParams(search)), [search]);
}

export default useQueryParams;
