Browse Source

kill class props

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

26
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.setState(state => ({ this.toggleTheme = () => {
theme: this.setState(state => ({
state.theme === themes.dark theme:
? themes.light state.theme === themes.dark
: themes.dark, ? themes.light
})); : themes.dark,
}; }));
};
}
render() { render() {
//highlight-range{1-3} //highlight-range{1-3}

Loading…
Cancel
Save