TLDR Tech / Dev
Do we need state management libraries anymore?
This article goes over how Redux, Zustand, Jotai, MobX, and Valtio work internally, showing they reduce to three patterns (pub/sub with selectors, atom graphs, and proxy read-tracking) that nearly all funnel through useSyncExternalStore to prevent tearing under concurrent rendering. It then rebuilds a Zustand equivalent in ~50 lines, hitting the classic pitfalls along the way: subscription races, stale selector closures, and infinite loops from selectors returning fresh object literals. Once state is split into UI, server cache, URL, and config buckets, the leftover slice is small enough that 50 lines you understand will do.
Read the full story