From fb8e9e8a1ba582a918453d3839fad8f1e73d854a Mon Sep 17 00:00:00 2001 From: Alex Krolick Date: Fri, 23 Mar 2018 11:43:41 -0700 Subject: [PATCH] kill class props --- examples/context/theme-detailed-app.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/examples/context/theme-detailed-app.js b/examples/context/theme-detailed-app.js index 618a6631..1a5efc21 100644 --- a/examples/context/theme-detailed-app.js +++ b/examples/context/theme-detailed-app.js @@ -11,18 +11,20 @@ function Toolbar(props) { } class App extends React.Component { - state = { - theme: themes.light, - }; - - toggleTheme = () => { - this.setState(state => ({ - theme: - state.theme === themes.dark - ? themes.light - : themes.dark, - })); - }; + constructor(props) { + this.state = { + theme: themes.light, + }; + + this.toggleTheme = () => { + this.setState(state => ({ + theme: + state.theme === themes.dark + ? themes.light + : themes.dark, + })); + }; + } render() { //highlight-range{1-3}