MCPcopy Create free account
hub / github.com/callstack/react-theme-provider / App

Class App

examples/web/src/App.js:12–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10import type { Theme } from './theming';
11
12class App extends React.Component<*, { theme: Theme }> {
13 state = {
14 theme: themes.default,
15 };
16
17 handleThemeChange = (themeName: string) => {
18 this.setState({ theme: themes[themeName] });
19 };
20
21 render() {
22 return (
23 <ThemeProvider theme={this.state.theme}>
24 <div>
25 <Header />
26 <ThemeChanger
27 onChangeTheme={this.handleThemeChange}
28 themes={Object.keys(themes)}
29 />
30 </div>
31 </ThemeProvider>
32 );
33 }
34}
35
36export default App;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected