From the course: Build Modern Web Apps with React, Hooks, State Management, and APIs Using Vite or Next.js

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Server-side sync

Server-side sync

Welcome back. In the last video, we set up everything and got our solution working with the help of 10 stack query. We are getting the products and with the help of Redux toolkit, we are managing our card nicely. We are fetching everything from the API and now we have to check that whether 10 stack query does the job or not. So we have been fetching the products in the previous Redux toolkit and the React query as well. And we can do that by SWR2. But the real power of TanStack Query is the mutations. The support for mutations and the server side syncing is what actually makes TanStack Query stands out. So let's do the check. I'm going to open VS Code and I will open them side by side. So at one place this and the other place should be the VS Code. So you can see that once we hit in API for deleting an item, we should be able to see that item instantly getting removed from here. So tanstack query is syncing with the API data and it's going to update the products for us. For this, I'm…

Contents