I’m trying to implement something like that
class Counter extends React.Component {
constructor(props) {
super(props)
this.state = {
count: props.initialCount
}
}
handleClick: () => {
this.setState({count: this.state.count + 1})
}
render() {
return (
<span onClick={this.handleClick}>this.state.count</span>
)
}
}