Last active
August 9, 2022 07:34
-
-
Save munierujp/fd64d9304ffa95353fc48412a43f7a89 to your computer and use it in GitHub Desktop.
Revisions
-
munierujp revised this gist
Aug 9, 2022 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ import { useMemo } from 'react' import { useLocation } from 'react-router-dom' /** * @see https://v5.reactrouter.com/web/example/query-parameters */ export const useQueryParams = (): URLSearchParams => { const { search } = useLocation() return useMemo(() => new URLSearchParams(search), [search]) } -
munierujp created this gist
Aug 9, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ import { useMemo } from 'react'; import { useLocation } from 'react-router-dom'; /** * @see https://v5.reactrouter.com/web/example/query-parameters */ export const useQueryParams = (): URLSearchParams => { const { search } = useLocation(); return useMemo(() => new URLSearchParams(search), [search]); };