Since the state.status will always change when the mutate function fires, the memoisation of useCallback fails and can cause runaway effects if the mutate function is passed in the dependency array of a useEffect.
if (![statusIdle, statusSuccess, statusError].includes(state.status)) {
return
}
https://github.com/tannerlinsley/react-query/blob/a76d1dfdc0a6d13ace169ce46ad8aef868ed4dd7/src/useMutation.js#L68-L99
Since the state.status will always change when the mutate function fires, the memoisation of useCallback fails and can cause runaway effects if the mutate function is passed in the dependency array of a useEffect.
if this check needed for anything in particular?