mutate instead of mutateAsyncmutation.status, usually the handlers are the best for that. mutation.status is nice for conditional renderingmutation.error cuz that's not going to be updated in time I don't think. mutateAsync returns the data so just put that token.set stuff in the try block and set using the return value of mutateasyncmutateAsyncmutateAsyncmutation.statusmutation.statusmutation.errortoken.settrytrpc.auth.login.useMutation({
onSuccess: (data)=>{
token.set(data.token)
},
onError: (error)=>{
// update error state here
}
})