From 0a2be1615eb3aee79520cc4a5dd9c7ee7a6c02f7 Mon Sep 17 00:00:00 2001 From: cv <34649812+cpvalente@users.noreply.github.com> Date: Wed, 26 May 2021 20:44:09 +0200 Subject: [PATCH] improve: stop list rerender react-query would trigger re-render on refetch even when using cache --- client/src/app/hooks/useFetch.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/app/hooks/useFetch.js b/client/src/app/hooks/useFetch.js index 3ddbdeaba..eceaf10d8 100644 --- a/client/src/app/hooks/useFetch.js +++ b/client/src/app/hooks/useFetch.js @@ -5,6 +5,7 @@ export const useFetch = (namespace, fn) => { const { data, status, isError, refetch } = useQuery(namespace, fn, { refetchInterval: refetchIntervalMs, cacheTime: Infinity, + notifyOnChangeProps: 'tracked', }); return { data, status, isError, refetch };