UNPKG

beautiful-react-hooks

Version:

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

13 lines (12 loc) 481 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = require("react"); var react_router_dom_1 = require("react-router-dom"); /** * Wraps the business logic of retrieve always updated URLSearchParams */ var useURLSearchParams = function () { var search = (0, react_router_dom_1.useLocation)().search; return (0, react_1.useMemo)(function () { return new URLSearchParams(search); }, [search]); }; exports.default = useURLSearchParams;