Juan Salvador (14) [Avatar] Offline
#1
In the below code:
constructor(props) {
    super(props)
    this.state = {label: 'Run'}
    this.state.handleClick = this.handleClick.bind(this)
}


I got the warning messsage:

...Do not mutate state directly. Use setState()...


I fixed up:

constructor(props) {
super(props)
this.state = {label: 'Run', handleClick: this.handleClick.bind(this)}
}


no warnings !

Please let me know if this changed code is OK
Azat Mardan (41) [Avatar] Offline
#2