When you’re talking about global state, you do mean client state, because react-query already is a global server state manager . Call useQuery with the same key twice and you’ll get the data.
Read moreIs React Query a replacement for redux?
React-Query and context api can never replace redux (they are not the same thing ).
Read moreWhat is React Query?
React Query is often described as the missing data-fetching library for React , but in more technical terms, it makes fetching, caching, synchronizing and updating server state in your React applications a breeze.
Read moreDoes React have built in state management?
React’s useState is the best option for local state management . If you need a global state solution, the most popular ones are Redux, MobX, and built-in Context API. Your choice will depend on the size of your project, your needs, and your engineers’ expertise.
Read moreIs React context a state manager?
React context is nothing but a global state to the app . It is a way to make a particular data available to all the components no matter how they are nested. Context helps you broadcast the data and changes happening to that data, to all the components.
Read more