fix(types): stricter type condition for EventHandlers (#12840)

fix #12832
This commit is contained in:
webfansplz 2022-11-09 17:25:28 +08:00 committed by GitHub
parent a5afc4d0a4
commit 0b3cf7dda9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

4
types/jsx.d.ts vendored
View File

@ -1297,7 +1297,9 @@ export interface Events {
} }
type EventHandlers<E> = { 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
} }
type ReservedProps = { type ReservedProps = {