`delegateHandler` needs event type that includes `delegateTarget`
Tokimon opened this issue · comments
Toke Voltelen commented
in a usage I had to hack the type a bit to make TS accept e.delegateTarget
:
const onClick = delegateHandler(`.${fileTileContainer}`, (e: Event) => {
const { delegateTarget: thumb } = e as Event & { delegateTarget: Element };
dispatch('thumbclick', { thumb });
});