Problem is here Element, document, and window can be an EventTarget. You should detect your EventTarget if is an element. So in your case below code should work
linkProvider = (ev: React.SyntheticEvent<EventTarget>) => {
// If event target not an HTMLButtonElement, exit
if (!(ev.target instanceof HTMLButtonElement)) {
return;
}
console.debug('ev.target', ev.target.dataset['ix'])
}
In the short way
linkProvider = (ev: React.SyntheticEvent<HTMLButtonElement>) => {
console.debug('ev.target', ev.currentTarget.dataset['ix'])
}
And also i added example here