import React, { Component } from 'react'
export default class CounterAppClass extends Component {
constructor(props) {
super();
this.state = {
count: 0
}
}
handleIncrease() {
this.setState({
count: this.state.count + 1
})
}
render() {
return (
<div className='card'>
<div className="card-body">
<h3 className='text-center mb-2'>Class based Component Counter</h3>
<h5>Count is: {this.state.count}</h5>
<button className='btn btn-primary w-100 mt-3' onClick={this.handleIncrease.bind(this)}>Increase</button>
</div>
</div>
)
}
}