Chapter 8 · Example 5 · React Context and performance

Splitting providers

Separating the changing state and the stable open and close functions into two Contexts lets components that only use the API skip state-change re-renders.

Loading live editor…