Skip to content

Commit c2eca7e

Browse files
committed
docs: update faq
1 parent adb5ea3 commit c2eca7e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/src/pages/docs/guides/does-this-replace-client-state.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ Well, let's start with a few important items:
88
- React Query is a **server-state** library, responsible for managing asynchronous operations between your server and client
99
- Redux, MobX, Zustand, etc. are **client-state** libraries that _can be used to store asynchronous data, albeit inefficiently when compared to a tool like React Query_
1010

11-
With those points in mind, the short answer is that React Query will likely replace _almost all of your **asynchronous** code that you currently pipe through your **client** state management library_.
11+
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.**
1212

13-
For a vast majority of applications, the **client** state that is left over after migrating all of your async code to React Query is usually very miniscule. In rare cicurmstances, an application might indeed have a massive amount of synchronous client-only state (like a visual designer or music production application), in which case, you will probably still want a client state manager. And that's fine, you can use React Query along side client state managers without any issues!
13+
For a vast majority of applications, the truly **globally accessible client state** that is left over after migrating all of your async code to React Query is usually very tiny.
1414

15-
So as _probable side-effect_, **yes**. React Query can replace Redux, MobX or any other global state manager, if you are primarily using it to cache your server-side data.
15+
> There are still some cicurmstances where an application might indeed have a massive amount of synchronous client-only state (like a visual designer or music production application), in which case, you will probably still want a client state manager. In this situation it's important to note that **React Query is not a replacement for local/client state management**. However, you can use React Query along side most client state managers with zero issues.
1616
17-
## A more detailed example
17+
## A Contrived Example
1818

1919
Here we have some "global" state being managed by a global state library:
2020

@@ -25,7 +25,7 @@ const globalState = {
2525
tasks,
2626
users,
2727
themeMode,
28-
sidebarOpen,
28+
sidebarStatus,
2929
}
3030
```
3131

@@ -34,7 +34,7 @@ Currently, the global state manager is caching 4 types of server-state: `project
3434
```js
3535
const globalState = {
3636
themeMode,
37-
sidebarOpen,
37+
sidebarStatus,
3838
}
3939
```
4040

0 commit comments

Comments
 (0)