From a1eca2d268b9d8195184ee0ab09eb78761e471e9 Mon Sep 17 00:00:00 2001 From: webfansplz <308241863@qq.com> Date: Wed, 19 Oct 2022 17:41:55 +0800 Subject: [PATCH] fix(types): stricter type condition for `EventHandlers` --- types/jsx.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/jsx.d.ts b/types/jsx.d.ts index 4924f4c643c..845cfdcb030 100644 --- a/types/jsx.d.ts +++ b/types/jsx.d.ts @@ -1297,7 +1297,9 @@ export interface Events { } type EventHandlers = { - [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 } type ReservedProps = {