Does react-query act as a state management library? Can I use it with Redux? #329
-
does react-query act as a state management library? Pls someone give an example or some repo or tutorial post Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
React Query is a type of state manager, specifically designed to manage asynchronous state that you get from outside of your app, so server-state, API state, or anything else that is not local client state. With that said, it's easy and even encouraged to keep use React Query along side a global state manager for your client state. Its very common for existing applications that after moving their server state to React Query, their client state is extremely small and doesn't even need an external library like Redux. However, some applications actually do have a lot of local client state to manage and something like Redux is warranted. I will link to a talk about this very subject very soon. But you can feel good pressing forward using both React Query for anything that is asynchronous data and Redux for anything that is local and synchronous. |
Beta Was this translation helpful? Give feedback.
React Query is a type of state manager, specifically designed to manage asynchronous state that you get from outside of your app, so server-state, API state, or anything else that is not local client state. With that said, it's easy and even encouraged to keep use React Query along side a global state manager for your client state.
Its very common for existing applications that after moving their server state to React Query, their client state is extremely small and doesn't even need an external library like Redux. However, some applications actually do have a lot of local client state to manage and something like Redux is warranted.
I will link to a talk about this very subject very soon…