Add return to render

This commit is contained in:
lucas
2016-12-01 19:17:49 -03:00
parent d7b1599f88
commit ab12949031

View File

@@ -79,11 +79,13 @@ class CounterButton extends React.Component {
}
render() {
<button
color={this.props.color}
onClick={() => this.setState(state => ({count: state.count + 1}))}>
Count: {this.state.count}
</button>
return (
<button
color={this.props.color}
onClick={() => this.setState(state => ({count: state.count + 1}))}>
Count: {this.state.count}
</button>
);
}
}
```
@@ -98,11 +100,13 @@ class CounterButton extends React.PureComponent {
}
render() {
<button
color={this.props.color}
onClick={() => this.setState(state => ({count: state.count + 1}))}>
Count: {this.state.count}
</button>
return (
<button
color={this.props.color}
onClick={() => this.setState(state => ({count: state.count + 1}))}>
Count: {this.state.count}
</button>
);
}
}
```