Navigation Menu

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 committed 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
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.