Browse Source

kill class props

main
Alex Krolick 7 years ago
parent
commit
fb8e9e8a1b
  1. 24
      examples/context/theme-detailed-app.js

24
examples/context/theme-detailed-app.js

@ -11,18 +11,20 @@ function Toolbar(props) {
} }
class App extends React.Component { class App extends React.Component {
state = { constructor(props) {
theme: themes.light, this.state = {
}; theme: themes.light,
};
toggleTheme = () => { this.toggleTheme = () => {
this.setState(state => ({ this.setState(state => ({
theme: theme:
state.theme === themes.dark state.theme === themes.dark
? themes.light ? themes.light
: themes.dark, : themes.dark,
})); }));
}; };
}
render() { render() {
//highlight-range{1-3} //highlight-range{1-3}

Loading…
Cancel
Save