Replies: 1 comment
-
Not really true. When you re-mount a component, it gets a new mutation instance that isn't tied to the previous mutation. That one is still in pending state and will eventually transition to success. You can see that in the query devtools in the mutations tab. |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to understand what the expected behavior is when the component is unmounted after/during a mutation.
Looks like there's a related test:
https://github.com/TanStack/query/blob/main/packages/react-query/src/__tests__/useMutation.test.tsx#L649-L667 . But there's no assertion (not sure if I'm missing something).
Current behavior is for it to reset to idle: https://codesandbox.io/p/sandbox/tq-mutation-6dhzlf
Beta Was this translation helpful? Give feedback.
All reactions