In onClick event i capture the event(e) in a function and trying to get the name of the element that was clicked
const ClickEvent = (e) => {
console.log(e.target.name) -> undefined
}
<svg>
<text onClick={ClickEvent} name="line1">
hello world
</text>
</svg>