diff options
Diffstat (limited to 'modern/src/common')
-rw-r--r-- | modern/src/common/useQuery.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modern/src/common/useQuery.js b/modern/src/common/useQuery.js index 92398bf8..ed3f74c1 100644 --- a/modern/src/common/useQuery.js +++ b/modern/src/common/useQuery.js @@ -1,3 +1,7 @@ +import { useMemo } from 'react'; import { useLocation } from 'react-router-dom'; -export default () => new URLSearchParams(useLocation().search); +export default () => { + const { search } = useLocation(); + return useMemo(() => new URLSearchParams(search), [search]); +} |