#How to share useMutation() return value across components?
5 messages · Page 1 of 1 (latest)
With useMutationState
Hi there!
I looked into this!
I want to check if a specific mutation call is pending and get that specific calls variables.
However, since useMutationState returns an array, I end up getting an array of each mutation.state for each of the calls.
This leaves me no way to identify the specific mutation.state that I want to read from. Any ideas?
I have thought that perhaps after each mutation call succeeds, I could clear that particular mutation cache, meaning that useMutationState() will theoretically always return an array of length 1.
Any help is appreciated! 🙂