Browse Source

fix(types): stricter type condition for `EventHandlers` (#6855)

fix #6899
Johnson Chu 3 years ago
parent
commit
bad3f3ce46
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/runtime-dom/types/jsx.d.ts

+ 1 - 1
packages/runtime-dom/types/jsx.d.ts

@@ -1301,7 +1301,7 @@ export interface Events {
 }
 
 type EventHandlers<E> = {
-  [K in keyof E]?: E[K] extends Function ? E[K] : (payload: E[K]) => void
+  [K in keyof E]?: E[K] extends (...args: any) => any ? E[K] : (payload: E[K]) => void
 }
 
 // use namespace import to avoid collision with generated types which use