score:0

the problem is not with your doclick method, it is with the click method you have specified within it.

in this method:

doclick(index) {
 this.props.click(index);
}

the problem you have is that you have not specified a click method prop.

either pass in a click method via the props (though i'd recommend instead using onclick handler), or handle the click event in your component. see my example here:

https://codesandbox.io/s/mo7j742kkj


Related Query

More Query from same tag