Skip to content

EventHandlers type error, DOM's Event was tainted by @types/node #12832

@ivan-94

Description

@ivan-94

Version

2.7.13

Reproduction link

www.typescriptlang.org/play

Steps to reproduce

open the reproduction link

What is expected?

<div @click="handleClick">ok</div> to work

What is actually happening?

Type '() => void' is not assignable to type 'MouseEvent'


DOM's Event was tainted by @types/node.

E[K] extends Function always true

type EventHandlers<E> = { [K in keyof E]?: E[K] extends Function ? E[K] : (payload: E[K]) => void }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions