mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 22:49:18 +00:00
improve: stop list rerender
react-query would trigger re-render on refetch even when using cache
This commit is contained in:
@@ -5,6 +5,7 @@ export const useFetch = (namespace, fn) => {
|
|||||||
const { data, status, isError, refetch } = useQuery(namespace, fn, {
|
const { data, status, isError, refetch } = useQuery(namespace, fn, {
|
||||||
refetchInterval: refetchIntervalMs,
|
refetchInterval: refetchIntervalMs,
|
||||||
cacheTime: Infinity,
|
cacheTime: Infinity,
|
||||||
|
notifyOnChangeProps: 'tracked',
|
||||||
});
|
});
|
||||||
|
|
||||||
return { data, status, isError, refetch };
|
return { data, status, isError, refetch };
|
||||||
|
|||||||
Reference in New Issue
Block a user