I have the following code in jsx:
<ol>
{
[a, b, ..., z].map((item, index) => <li><pre id={index}>{item}<button onClick={() => commands.copyText(this)}>Copy</button></pre></li>)
}
</ol>
I want to copy the contents of the item on click of my Copy button but I'm not able to pass it as a parameter for some reason, is there a way to copy it using the pre id?