T
TanStack3y ago
stormy-gold

sideEffect on useMutation not working

Hey, I am trying to update a state upon success of a useMutation, before I added the sideEffect itt was all working fine but when I implemented the onSuccess side effect I am getting error I posted below. postMessage is an asycn function I am exporting from another file. It takes 3 parameters sessionId, userId, input
No description
No description
4 Replies
correct-apricot
correct-apricot3y ago
which version are you on?
stormy-gold
stormy-goldOP3y ago
V5 I also had issues passing multiple parameters to the postMessage function I need seed 3 arguments but only 1 is being sent
correct-apricot
correct-apricot3y ago
Migrating to TanStack Query v5 | TanStack Query Docs
Breaking Changes v5 is a major version, so there are some breaking changes to be aware of:
stormy-gold
stormy-goldOP3y ago
Yeah thought so. but how come into mutation function i can only send 1 argument? I found a way around it. I am sending my arugments in a object like this mutation({param1: x , param2: y})

Did you find this page helpful?