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


4 Replies
rare-sapphire•2y ago
which version are you on?
eastern-cyanOP•2y ago
V5
I also had issues passing multiple parameters to the postMessage function
I need seed 3 arguments but only 1 is being sent
rare-sapphire•2y ago
it's the first thing in the migration guide ?
https://tanstack.com/query/v5/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object
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:
eastern-cyanOP•2y 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})