Skip to content

Commit

Permalink
[@mantine/hooks] use-window-event: Improve events type (#4423)
Browse files Browse the repository at this point in the history
* Update use-window-event.ts: Fixed types

* Update use-window-event.ts: Fixed types (solution v2)
  • Loading branch information
vadimkiryanov committed Jun 20, 2023
1 parent 94b0ab5 commit a9255c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mantine-hooks/src/use-window-event/use-window-event.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect } from 'react';

export function useWindowEvent<K extends string>(
export function useWindowEvent<K extends string = keyof WindowEventMap>(
type: K,
listener: K extends keyof WindowEventMap
? (this: Window, ev: WindowEventMap[K]) => void
Expand Down

0 comments on commit a9255c6

Please sign in to comment.