T
TanStack2y ago
adverse-sapphire

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
national-gold
national-gold2y ago
which version are you on?
adverse-sapphire
adverse-sapphireOP2y ago
V5 I also had issues passing multiple parameters to the postMessage function I need seed 3 arguments but only 1 is being sent
national-gold
national-gold2y 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:
adverse-sapphire
adverse-sapphireOP2y 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?