A mid-level developer understands that not all state should be global. Knowing where data lives is the first step to a clean architecture.
1The Immutability Law
Never mutate state directly. Using patterns like the 'spread operator' or libraries like 'Immer' ensures that your framework's change detection works perfectly every time.
2Atomic State
Libraries like Recoil or Jotai use 'Atoms'—tiny pieces of state that components can subscribe to individually. This prevents the 'Mega-Store' bottleneck where every update re-renders the whole app.
3Asynchronous Sagas
Handling side effects (like API calls) is the hardest part of state management. Whether you use Thunks, Sagas, or Observables, the goal is to keep your logic separate from your UI.
