Skip to content

Commit

Permalink
fix(types): stricter type condition for EventHandlers (#12840)
Browse files Browse the repository at this point in the history
fix #12832
  • Loading branch information
webfansplz authored Nov 9, 2022
1 parent a5afc4d commit 0b3cf7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion types/jsx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,9 @@ 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
}

type ReservedProps = {
Expand Down

0 comments on commit 0b3cf7d

Please sign in to comment.