2
0
Эх сурвалжийг харах

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

fix #6899
Johnson Chu 3 жил өмнө
parent
commit
bad3f3ce46

+ 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