mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
one liner
This commit is contained in:
@@ -73,9 +73,7 @@ var Counter = React.createClass({
|
|||||||
return {count: this.props.initialCount};
|
return {count: this.props.initialCount};
|
||||||
},
|
},
|
||||||
handleClick: function() {
|
handleClick: function() {
|
||||||
this.setState({
|
this.setState({count: this.state.count + 1});
|
||||||
count: this.state.count + 1
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
return <div onClick={this.handleClick}>{this.state.count}</div>;
|
return <div onClick={this.handleClick}>{this.state.count}</div>;
|
||||||
|
|||||||
Reference in New Issue
Block a user