UNPKG

beautiful-react-hooks

Version:

A collection of beautiful (and hopefully useful) React hooks to speed-up your components and hooks development

11 lines (10 loc) 336 B
import { useMemo } from 'react'; import { useLocation } from 'react-router-dom'; /** * Wraps the business logic of retrieve always updated URLSearchParams */ const useURLSearchParams = () => { const { search } = useLocation(); return useMemo(() => new URLSearchParams(search), [search]); }; export default useURLSearchParams;