-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
docs: Update query-cancellation.md #1328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add sample code to manually cancel a query.
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tannerlinsley/react-query/7yp7txhfo |
I am not sure if setting the query key to empty string is advice we should be giving:
I also tried setting the query to While typing this, I found out that all you need is |
it seems like you're using react-query 3.2.0. I tested using 2.26.3 here https://codesandbox.io/s/inspiring-northcutt-scc73?file=/src/App.js, and I need to also set enabled to false in addition to setting the key to empty string. I couldn't find |
yes, QueryClient is v3 (beta), it's QueryCache in v2: https://react-query.tanstack.com/docs/api#querycachecancelqueries sorry for the confusion 🙃 |
Ah you're right. I actually tried |
Please add this to the |
🎉 This PR is included in version 2.26.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.2.0-beta.32 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 2.26.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Add sample code to manually cancel a query.