Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ivan-94 opened this issue Oct 16, 2022 · 0 comments · Fixed by #12840
Closed

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

ivan-94 opened this issue Oct 16, 2022 · 0 comments · Fixed by #12840

Comments

@ivan-94
Copy link

ivan-94 commented Oct 16, 2022

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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant