From 0b3cf7dda9ac605b2b9f799acacd2793e974f225 Mon Sep 17 00:00:00 2001 From: webfansplz <308241863@qq.com> Date: Wed, 9 Nov 2022 17:25:28 +0800 Subject: [PATCH] fix(types): stricter type condition for `EventHandlers` (#12840) fix #12832 --- 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 = {