Browse Source

one liner

main
Jared Forsyth 11 years ago
parent
commit
ba50af55f7
  1. 4
      tips/10-props-in-getInitialState-as-anti-pattern.md

4
tips/10-props-in-getInitialState-as-anti-pattern.md

@ -73,9 +73,7 @@ var Counter = React.createClass({
return {count: this.props.initialCount};
},
handleClick: function() {
this.setState({
count: this.state.count + 1
});
this.setState({count: this.state.count + 1});
},
render: function() {
return <div onClick={this.handleClick}>{this.state.count}</div>;

Loading…
Cancel
Save