State management has always been a topic of discussion in front end applications. Existing solutions such as Redux, Mobx, et cetera are oriented towards client side state management. However in this article we are going to concentrate on efficiently managing state fetched from the server.

What does server state actually mean?

Any piece of data that is fetched from the server can be termed as server state. For example publications you are subscribed to, stories you have clapped for, stories that you have written are all server state. An example of client state can be the user’s theme preference (light or dark).

It can become tricky to control information stored on a remote server. Besides, server data comes with inherent challenges of caching, fetching, updating, and synchronizing the application’s state with the server’s state.

Let’s take a look at how react query helps solve these problems.

  • Fetching Data
  • Caching Data
  • Synchronizing Data
  • Updating Data

#react-query #react #reactjs #javascript

An Overview of React Query
2.30 GEEK