-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
Describe the bug
I have some disabled queries awaiting for some change on my components.
And even if the value doesn't change, the queryFn is called at each refetchInterval.
To Reproduce
const [neverUpdatedValue] = React.useState(null);
useQuery({
queryKey: ["test", neverUpdatedValue],
queryFn: (key, value) => {
console.log(key, value);
return Promise.resolve();
},
config: {
enabled: !!neverUpdatedValue,
refetchInterval: 2000
}
});
I set up a sandbox derived from your "Basic" example :
https://codesandbox.io/s/busy-moon-pon1t?file=/src/index.js
The refretchInterval triggers the queryFn even if it is disabled.
Expected behavior
Do not trigger the queryFn.
Desktop (please complete the following information):
- Version 2.2.3
lndgalante, niconiahi, TDLehman, Frumba and kizivat