Skip to content

Commit

Permalink
[@mantine/hooks] use-window-event: Fix event listener not being updat…
Browse files Browse the repository at this point in the history
…ed when event type or function changes
  • Loading branch information
rtivital committed Nov 6, 2022
1 parent b0a6c56 commit 4b3d7ce
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
Expand Up @@ -10,5 +10,5 @@ export function useWindowEvent<K extends string>(
useEffect(() => {
window.addEventListener(type, listener, options);
return () => window.removeEventListener(type, listener, options);
}, []);
}, [type, listener]);
}

0 comments on commit 4b3d7ce

Please sign in to comment.