Explorar o código

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

fix #6899
Johnson Chu %!s(int64=3) %!d(string=hai) anos
pai
achega
bad3f3ce46
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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