invalidateQueries
: mark as staleremoveQueries
: remove from cacheThis can be useful if you’re initially populating a form object from the data, so a rerender later won’t update it.
The most reliable way is to call queryClient.removeQueries()
so the data is not present at all.
new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
retry: false,
staleTime: 5000,
},
},
});
enabled
is not true
Check to see if it’s undefined
; RQ will run the query when it’s undefined
. Safest to make totally sure it’s actually true
or false
- https://github.com/TanStack/query/issues/1196#issuecomment-2043328137