Skip to content

Instantly share code, notes, and snippets.

@alicarbonteq
Last active October 12, 2021 09:04
Show Gist options
  • Save alicarbonteq/7d4554e60aeeb40e9c39f4ebf488cf66 to your computer and use it in GitHub Desktop.
Save alicarbonteq/7d4554e60aeeb40e9c39f4ebf488cf66 to your computer and use it in GitHub Desktop.
React Query

React Query

React Query is a server-state** library, responsible for managing asynchronous operations between your server and client

Redux, MobX are client-state libraries that can be used to store asynchronous data, albeit inefficiently when compared to a tool like React Query

With those points in mind, the short answer is that React Query replaces the boilerplate code and related wiring used to manage cache data in your client-state and replaces it with just a few lines of code.

With a few hook calls to useQuery and useMutation, we also get to remove any boilerplate code that use to manage our server state eg.

  • Action Creators
  • Middlewares
  • Reducers
  • Loading/Error/Result states
  • Contexts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment