-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Describe the bug
After upgrading to @tanstack/react-query
v5.89.0
, my code using useMutation
started failing because the onError
callback now expects an extra parameter between variables
and context
(onMutateResult
). This change came from PR #9615.
The same applies for onSuccess
and onSettled
.
Your minimal, reproducible example
Steps to reproduce
Previously this compiled: onError(error, variables, context) { /* ... */ }
In v5.89.0 it now must be: onError(error, variables, onMutateResult, context) { /* ... */ }
Expected behavior
Was it expected to ship this as a patch even though it’s breaking? If yes, a doc/changelog note would probably help.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Not relevant
Tanstack Query adapter
None
TanStack Query version
5.89.0
TypeScript version
5.9.2
Additional context
I am creating this issue also to help anyone confused after upgrading.
evgarthub, fzaninotto, moimael and markmssd
Metadata
Metadata
Assignees
Labels
No labels