CancelledError from queryClient.cancelQueries: something to act on or ignore?
Just saw this in Sentry when using cancelQueries in the optimistic update pattern. Just wondering what this is ultimately telling me? Should I just wrap it in a try/catch?
Based on the code from the docs:
https://tanstack.com/query/v5/docs/framework/react/guides/optimistic-updates#updating-a-list-of-todos-when-adding-a-new-todo
Optimistic Updates | TanStack Query React Docs
React Query provides two ways to optimistically update your UI before a mutation has completed. You can either use the onMutate option to update your cache directly, or leverage the returned variables...


1 Reply
harsh-harlequinOP•4w ago
(I do see by the way that cancelQueries wants an object passed in and not the queryKey itself. Gonna update that at least)