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
class ExampleComponent extends React.Component {
// highlight-range{1-4}
// highlight-range{1-5}
state = {
currentColor: this.props.defaultColor,
palette: 'rgb'
currentColor: this.props
.defaultColor,
palette: 'rgb',
};
}

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

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

Loading…
Cancel
Save