I was modifying the the theme ,toggle-theme example in react-docs: https://reactjs.org/docs/context.html#updating-context-from-a-nested-component Here\'s how the App.js look