I am trying to render React components using loop, Basically its link tag having on click function with value.
<p><a href="#" key={i} onClick={() => this.decreaseCount(i)} >delete</a></p>
where i is the index of the for loop. The problem is, instead of getting i's value inside this.decreaseCount(i) I am getting length of array. However I am getting correct index with key={i}
Need help!