What is React Query and why is it in this book?
First things first: let’s talk about the name of this library. In this chapter, I use the name React Query, it is also a commonly used name. However, the creator of React Query, Tanner Linsley, did some restructuring in 2022, in the open source libraries that he owns and maintains. He created an umbrella name, TanStack, and placed a plethora of libraries under this name. And so, React Query became TanStack Query, as of React Query version 4. You can find a link to the TanStack home page in the Further reading section at end of this chapter.
Now that we have the name out of the way, let’s talk about the place of React Query in this book. React Query is not a state management library. It’s a library offering a solution for comfortable fetching and data mutations on the server. Why are we talking about it then? Because it turns out that efficient communication with the server can replace any need for global state...