Property ‘dataset’ does not exist on type ‘EventTarget’
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 … Read more