Browse Source

Prettier

main
Brian Vaughn 7 years ago
parent
commit
06d5be4571
  1. 7
      examples/update-on-async-rendering/initializing-state-after.js
  2. 9
      examples/update-on-async-rendering/initializing-state-before.js

7
examples/update-on-async-rendering/initializing-state-after.js

@ -1,8 +1,9 @@
// After // After
class ExampleComponent extends React.Component { class ExampleComponent extends React.Component {
// highlight-range{1-4} // highlight-range{1-5}
state = { state = {
currentColor: this.props.defaultColor, currentColor: this.props
palette: 'rgb' .defaultColor,
palette: 'rgb',
}; };
} }

9
examples/update-on-async-rendering/initializing-state-before.js

@ -2,11 +2,12 @@
class ExampleComponent extends React.Component { class ExampleComponent extends React.Component {
state = {}; state = {};
// highlight-range{1-6} // highlight-range{1-7}
componentWillMount() { componentWillMount() {
this.setState({ this.setState({
currentColor: this.props.defaultColor, currentColor: this.props
palette: 'rgb' .defaultColor,
palette: 'rgb',
}); });
} }
} }

Loading…
Cancel
Save