query
query copied to clipboard
mutation function useCallback is always regenerated
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?
if (![statusIdle, statusSuccess, statusError].includes(state.status)) {
return
}
Closed with #166