Grokking React Native
0% completed
Handling Mutations with useMutation
How should an app add a user to the server, when useQuery can only read? A read can run whenever React Query decides, and it can run many times without harm. A request that creates a user must run once, at the moment the user presses a button. These requests therefore need a separate tool.
A mutation is any request that changes data on the server, such as creating an order, updating a profile, or deleting a comment. The useMutation hook runs one of these requests when you ask, and it tracks whether the request is running, has succeeded, or has failed.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%