From d9f7ca273c0d0e9d4ac8e7b196f4c28a3c5418fb Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 12 Mar 2024 16:47:50 -0600 Subject: [PATCH] Fixing issue where useQuery would continually set the query. --- app/src/hooks/customHooks.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/hooks/customHooks.js b/app/src/hooks/customHooks.js index 9fce1b85..3c4f9894 100644 --- a/app/src/hooks/customHooks.js +++ b/app/src/hooks/customHooks.js @@ -136,12 +136,12 @@ export const useQuery = (defaultParams) => { if (!_.isEmpty(state)) { console.debug('Changing URL params', state); } - }, [state]); + }, [JSON.stringify(state)]); React.useEffect(() => { // Keep URL and state in sync. setState(getSearchParamCopy(searchParams)); - }, [searchParams]); + }, [JSON.stringify(searchParams)]); const updateQuery = (newParams, replace = false) => { // Update the old state with the new values.