Context providers that pass unstable objects cause ALL consumers to re-render, even if the data they need hasn't changed. This is a potential performance killer.
ThemeProvider creates a new { theme, toggleTheme } object every renderuseMemo so it stays referentially stableHeader, which consumes context, only re-renders when the thread actually changesSubmit your code to see test results