Alternative to Redux. Instead of storing stuff internally in a redux store, react query does their own caching. On our side all we need to do is to fetch information from them, and they send us the most recent data if it hasn’t changed.

React Query is often seen as an alternative to Redux for handling server state in React applications, especially for cases where the primary need is data fetching, caching, and synchronization.

Here’s how React Query differs from Redux in this context:

  1. Automatic Caching: React Query handles caching for you. When you fetch data with React Query, it caches the data and will provide the cached version if it’s still valid. This is different from Redux, where you’d have to manually handle caching logic.

  2. Refetching and Synchronization: React Query automatically refetches data in the background when it becomes stale, or when certain events happen (e.g., the user focuses the window, the network reconnects). This helps keep the data in sync without additional code.

  3. Simplified API: Instead of setting up actions, reducers, and the Redux store, React Query requires minimal setup to start fetching and caching data.

So, in essence, all you typically need to do is fetch data through React Query’s API, and it handles the rest—like providing the most recent data from the cache if it hasn’t changed.

Automatic refreshing Caching Less code

Solves the problem of data management. Not data fetching exactly. Server state. Stuff from the database and such

https://www.youtube.com/watch?v=OrliU0e09io