Replies: 5 comments 1 reply
-
For reference I did the following as a workaround. |
Beta Was this translation helpful? Give feedback.
-
I agree that a cancelled query should not throw, I understand Fetch throw to force you to handle the case, but in this case it's safe to ignore a cancelled query because we are explicitly doing it |
Beta Was this translation helpful? Give feedback.
-
I ended up using this as a solution cause looking at constructor name doesn't work in the production build.
But i totally agree that cancel a query should not throw an error. At least you should be able to turn it off |
Beta Was this translation helpful? Give feedback.
-
In V3 cancellation will not throw an error anymore: https://react-query-beta.tanstack.com/ |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there, i have a page with tabs and on each tab a list of items. Those items are draggable in order to change the position of an item in the list.
The sort action is an optimistic mutation using react-query that cancels the list query.
When i go on a tab where i have already cached the list, there is a background request to update the list.
Therefore if i drag an item before this "background request" is finished, the optimistic mutation cancel the queries and the list cache has the
isError
to true and consequently my UI is in an error state.I expected the cancel to be quiet. Now i'm wondering how I could handle this. Should i stop cancelling the request or prevent the DnD while there is a fetching in the background 🤔
Beta Was this translation helpful? Give feedback.
All reactions