loading state for mutation
Are there any examples showing a loading state (spinner) while a mutation is in progress?
3 Replies
In React, something like
you could add some error handling if mutate could throw
hmmm, in that case I'm might just use TanStack's useMutation
Plus I check against undefined to show the spinner, and a “no data” component in case of null response to allow backend to say something like “not found”.