+Modern State Management Is a Problem of State Partitioning
In modern frontend development, state management is not simply about storing variables. It is about identifying what kinds of state exist in an application and determining the source owner, scope of use, lifetime, and synchronization rules of each kind of state.[Footnote 18]
The official Redux documentation also explains that not all state needs to be placed in a global store and that it is the developer’s responsibility to decide where each piece of state should reside. React likewise associates state with a position in the component tree, lifts shared state to a common owner, and recommends against separately storing duplicated state or state that can be derived.
Server state has different characteristics from local UI state. The source of truth for server state is owned by a remote system, while the client must cache it, refetch it, invalidate it, and handle stale state. Therefore, placing component state and server state in the same global object and managing them under the same lifetime rules can obscure their actual ownership and rules.[Footnote 19]
[Image]