);
}
function Footer() {
const { theme } = useContext(ThemeContext);
return ;
}
function App() {
return (
);
}
export default App;
/*
Notes:
- Header and Footer are siblings with no direct connection to each
other — both reach the same theme value purely through
useContext(ThemeContext), with nothing passed between them as props.
- Clicking Header's toggle button updates state inside ThemeProvider,
which re-renders both consumers with the new theme value.
*/