State management is a core concept in all three frameworks—React, Vue, and Angular—but each handles it a bit differently. Here's a breakdown to help you compare:
React: Component-Based + External Libraries
React is all about components and hooks. State is usually managed locally or via external libraries.
Local State:
Global State (popular libraries):
Example:
const [count, setCount] = useState(0);
Vue: Reactive System + Vuex or Pinia
Vue has a built-in reactivity system that makes state management feel natural.
Local State:
Global State:
Example:
const count = ref(0);
Angular: Services + RxJS
Angular uses services and dependency injection for state management, often combined with reactive programming.
Local State:
Global State:
Example:
count$ = new BehaviorSubject<number>(0);
Summary Table
Framework |
Local State |
Global State |
Popular Libraries |
React |
useState, useReducer |
Context, Redux, Zustand |
Redux, Recoil, Jotai |
Vue |
ref, reactive |
Vuex, Pinia |
Pinia |
Angular |
Component props |
Services + RxJS |
NgRx |