I took a look at the docu of React:
https://reactjs.org/docs/handling-events.html
and obviously event
is available in the event handlers. Thus you can easily get the target or clicked element and it's attributes:
function ActionLink() {
function handleClick(e) {
e.preventDefault();
console.log('The link was clicked.');
const title = e.target.title,
alt = e.target.alt;
console.log('Title=' +title + ' alt=' + alt);
}
return (
<a href="#" onClick={handleClick}>
Click me
</a>
);
}