I want to change the styling of an element when a button is clicked, but I can't figure out how to do so without changing the styles of all the elements in the array that haven't been clicked.
<div >
{props.stuff.map(item =>
<li className={itemClass}>
<div>{item}</div>
<button onClick={...change the style of the <li> without effecting the others}>Done</button>
</li>)}
</div>
I'm thinking I need to give each li a unique ID and access that ID in my click Handler function and apply another css class to only the li with that ID... except I can't figure out how to do that. Or I could be going in the wrong direction. Any suggestions would be very much appreciated!