Grokking React Advanced
0% completed
Updating Server Data with useMutation
One click on an Add post button sends two requests in this lesson: a POST that saves the new post, and a GET that loads the list again so that the screen shows it. The first request changes data on the server. The second exists because the cache no longer matches the server after the first one.
The lesson "Query Keys and Caching" followed the posts app while it only read data: query keys such as ['posts'] and ['post', 1], entries that turn stale after staleTime, and background refetches. This lesson continues the same app and adds the opposite direction, writing data.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%