From 2352071211b61c10fa5bf5736baaff7809d18bf0 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 8 May 2022 11:48:09 -0700 Subject: Organize common code --- modern/src/common/util/useQuery.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 modern/src/common/util/useQuery.js (limited to 'modern/src/common/util/useQuery.js') diff --git a/modern/src/common/util/useQuery.js b/modern/src/common/util/useQuery.js new file mode 100644 index 00000000..f246df7c --- /dev/null +++ b/modern/src/common/util/useQuery.js @@ -0,0 +1,7 @@ +import { useMemo } from 'react'; +import { useLocation } from 'react-router-dom'; + +export default () => { + const { search } = useLocation(); + return useMemo(() => new URLSearchParams(search), [search]); +}; -- cgit v1.2.3