State Management · Middle · Question 64 of 75
How does mutateAsync differ from mutate?
- ✓Correct answer:
mutateAsyncreturns a promise you can await (and must catch);mutatehandles errors via callbacks - 2
mutateAsyncruns on the server - 3They are the same
Explanation
Use mutate with onSuccess/onError for most UI; use mutateAsync when you need to chain logic, e.g. close a dialog after the save resolves.