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.

Recap: UseQuery fetching data using TanStack Query

Recap: UseQuery fetching data using TanStack Query

Hello and welcome back. Let's see the differences between RTK query and TAN stack query and when which of the library is recommended. If you have an existing project, which is already using Redux, then you should be looking to go forward with the RTK query because it is going to make things easier for your Redux operations and you will be able to integrate it very easily. But if you have a project which is getting started from the scratch and you are starting off something, then you should be considering the TanStack Query. Let's recap the setup for TanStack Query. If you remember in the previous module, we did an example with Redux module for TanStack query as well as RTK query. In the tanstack query example, we used a shopping cart project and that project was to list down all the products and we can add them in the cart and modify their quantities. We first have to install the tanstack package with react query and the xeos library. The Axios will be able to make HTTP requests…

Contents