context splitting
Dividing one large context into several smaller ones so components re-render only when the data they actually read changes.
In more detail
A common split puts state in one context and the stable dispatch function in another, so components that only send actions never re-render on state changes. It keeps each context value small and focused, so a change in one does not re-render readers of another.
Related terms
- React Context — A React feature that lets a parent component make a value available to every component below it without passing it as props.
- dispatch function — The function returned by useReducer that sends an action to the reducer and schedules a re-render with the result.
- render — In React, calling a component to find out what it should display now; a re-render is any render after the first.
Taught in
- useContext in Depth: Scoping, Consumer Subscription Costs — React 19 & Modern Component Architecture