constructor() {
super();
this.state = {
isSelected:0
}
}
handleClick(index){
console.log(index);
this.setState=({
isSelected:index
})
}
render() {
...
<li className={...} onClick={this.handleClick.bind(this,0)}></li>
...
)
}
for example, here I want to pass the value of 0 through the handleClick function. Index is passed into handleClick () but not this.setState ()
.