usInifiniuteQuery Doesnt cancel the query using cancelQueries() #4390
Unanswered
cubecleveland
asked this question in
General
Replies: 1 comment
-
Should work with the signal. Please show a codesandbox reproduction. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello using useInfnfinteQuery and cancelQuerioes to cancel specific queries...
The feature seem to not work with Infinitebut works with regular useQuery.. any one know wnaything about it as an open issue ?
Running react-query 3/34/0 tried both the old cancel method and the new method by passing the AborSignal
Here is our fecth code
const id = setTimeout(() => controller.abort(), 10000);
try {
const response = await fetch(url, {
method: "POST",
credentials: "include",
body: JSON.stringify(input),
signal,
});
clearTimeout(id);
if (!response.ok) {
reject(new Error("Problem fetching data"));
}
const data = await response.json();
});
promise.cancel = () => {
controller.abort();
};
return promise;
Beta Was this translation helpful? Give feedback.
All reactions