So the following code is in Angular 4 and I can\'t figure out why it doesn\'t work the way as expected.
Here is a snippet of my handler:
onUpdatingSe
I was looking for a solution to a similar TypeScript error with React:
Property 'dataset' does not exist on type EventTarget in TypeScript
I wanted to get to event.target.dataset of a clicked button element in React:
Here is how I was able to get the dataset value to "exist" via TypeScript:
const onClickHandler = (event: React.MouseEvent) => {
const { name, index } = (event.target as HTMLButtonElement).dataset
console.log({ name, index })
// do stuff with name and index…
}