I\'m mapping data from the api response and rendering multiple divs out of it. Along with that I\'m assigning a unique id from the response to the id attribute of each div l
In the constructor, just put this line:
constructor() { this.handleClick = this.handleClick.bind(this); }
After this, you will be able to access the ref to the element,
For more detail please go through this link : https://reactjs.org/docs/handling-events.html