one liner
Jared Forsyth committed
Dec 17, 2013 at 17:12 UTC
e539c8c6c4d23ce1d2ca98306d0b8a33c2a3b81c
1 file changed
+2
-4
docs/tips/10-props-in-getInitialState-as-anti-pattern.md
+2
-4
@@ -68,14 +68,12 @@ However, it's **not** an anti-pattern if you intentionally make it clear that sy
68
69
var Counter = React.createClass({
70
getInitialState: function() {
71
- // naming it initialX clearly indicates that the only purpose
71
+ // naming it initialX clearly indicates that the only purpose
72
// of the passed down prop is to initialize something internal
73
return {count: this.props.initialCount};
74
},
75
handleClick: function() {
76
- this.setState({
77
- count: this.state.count + 1
78
- });
76
+ this.setState({count: this.state.count + 1});
77
},
78
render: function() {
79
return <div onClick={this.handleClick}>{this.state.count}</div>;