Cloud functions executing the previous request? react

Hi, I don’t know if this is an error with my particular server…

It’s a testnet server 0.0.314 and I’m using the cloud function in React Moralis.

Whenever I send my cloud function, it executes the previous request. For example, I will request to join a room, it won’t do that until I do the next request…like start the game, and it won’t start the game until I do another request, say leave the room.

Anyone else experienced this?

Ok I figured out it’s because I was trying to find a work around to fetch() that resulted from useMoralisCloudFunction() seemingly not being able to receive new data.

//so I put a ref in there
const ref = useRef()
const { fetch } = useMoralisCloudFunction('FunctionName', ref.current)
//But it actually runs the previous params when I call fetch.
ref.current = {newParams}
fetch() // >:-(

So I figured out the source of the bug but I still don’t have a solution.

I created a new thread…how do I pass fetch something NEW!?