listItems present in render(). all functionality is working fine. i am trying to click on the row then it will execute projectDetails(). but it is showing below error:
inside render()
var listItems = this.state.projectList.map(function (item, index) {
return <tr key={index} onClick={this.projectDetails(item, index)}>
<td>{item.name}</td>
<td>{item.description}</td>
<td><i className="glyphicon glyphicon-trash" onClick={
function() {
showconfrim("Do you want to delete this Project?");
}
}></i></td>
</tr>
});
method
projectDetails(item, index) {
console.log(index);
}
constructor
constructor(props) {
super(props);
this.state = {
activePage: 1,
projectList: []
};
this.projectDetails = this.projectDetails.bind(this);
}