Context Internals
February 9, 20261 min readpart 07/13
When a Provider re-renders with a new value, React runs propagateContextChange: it walks the subtree, checks each Fiber's dependencies for this context, and marks matches with ForceUpdate — even through memoized ancestors.
Context is all-or-nothing. Any change to the value re-renders every consumer, regardless of which slice they read. There's no built-in selector. This is what libraries like Zustand and Jotai solve.
Further reading
- How Does Context Work Internally? (deep dive) jser.dev on propagateContextChange, the dependency list, and forced updates
- Context vs. Redux: Differences (article) Mark Erikson on why Context isn't a state manager and when each is appropriate
- use-context-selector (library) Daishi Kato's selector solution for Context; reveals the performance gap
- React Context Performance Pitfalls (article) Nadia Makarevich on splitting, memoizing, and composition patterns