−State management in modern frontend development is not simply about storing variables. It is about identifying what kinds of state exist in an application and deciding, for each one, its authoritative owner, scope of use, lifetime, and synchronization rules.[Footnote 18]
The Redux documentation explicitly notes that not all state needs to live in a global store, and that developers must decide where each piece of state belongs. React likewise associates state with a position in the component tree, recommends lifting shared state to the nearest common owner, and advises against separately storing duplicated or derivable state.
Server state differs fundamentally from local UI state. Its source of truth is owned by a remote system, while the client must cache it, refetch it, invalidate it, and deal with stale data. If component state and server state are placed in the same global object and managed under identical lifetime rules, their actual ownership and behavioral contracts can become obscured.[Footnote 19]
+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]