I'm trying to follow the examples that are coming up here on Stack Overflow and I can't get it to work. It works just fine if I remove everything that says "index" though. It passes in the "page" just fine. Can someone point me in the correct decision please thank you.
My Click function
handleOnClick(page, index) {
console.log(page); //page is correct
console.log(index); //undefined
}
My Render
let self = this;
playlistList[pos].list.map(function(page, index)
{if (page.selected) {
return (
<tr key={page.id} onClick={() => self.handleOnClick(page, index)}>
<td>{page.name}</td>
<td>{page.subComposition.name}</td>
</tr>
);}
}