-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
Describe the bug
Calling queryClient.invalidateQueries with { refetchActive: false } on inactive query actually refetches it.
To Reproduce
Codesandbox: https://codesandbox.io/s/react-query-refetchactive-bug-n3kwc
With the following query cache state:
['queryA'] // inactive
['queryB'] // active
When I call
// ❌ Incorrect, refetches 😵
queryClient.invalidateQueries(['queryA'], {
refetchActive: false
});
// ✅ Correct, doesn't refetch
queryClient.invalidateQueries(['queryB'], {
refetchActive: false
});
Expected behavior
Option { refetchActive: false } on inactive query shouldn't trigger refetch
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: macOS
- Browser: chrome
- Version: 90
Additional context
N.A