I want to render numbers from state, but when I click button nothing happens. How could I fix that?
class App extends Component {
state = {
hours: 0,
min: 0,
sec: 0
}
handleClick = () => {
this.setState({
sec: this.state.sec++
})
}
render() {
return (
<div>
<main className="time-change">
<form>
<h2>{this.state.hours}:{this.state.min}:{this.state.sec}</h2>
</form>
<button onClick={this.handleClick}>^</button>
</main>
</div>
)
}
}