Skip to content

Commit 5c95f28

Browse files
committed
fix: πŸ› fix TypeScript build errors
1 parent 3516aa6 commit 5c95f28

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

β€Žsrc/useEvent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ const useEvent = (name: string, handler?: null | undefined | ((event?: any) => v
1818
useEffect(() => {
1919
if (!handler) return;
2020
if (!target) return;
21-
const fn = ((target as ListenerType1).addEventListener || (target as ListenerType2).on);
21+
const fn: any = ((target as ListenerType1).addEventListener || (target as ListenerType2).on);
2222
fn.call(target, name, handler, options);
2323
return () => {
24-
const fn = ((target as ListenerType1).removeEventListener || (target as ListenerType2).off);
24+
const fn: any = ((target as ListenerType1).removeEventListener || (target as ListenerType2).off);
2525
fn.call(target, name, handler, options);
2626
};
2727
}, [name, handler, target, JSON.stringify(options)]);

β€Žsrc/useKeyPressEvent.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ const useKeyPressEvent = (
1010
onKeydown: KeyPressCallback = undefined
1111
) => {
1212
const useKeyboardJS: boolean = targetKey.length > 1;
13-
const pressedKeys: boolean = useKeyPress(targetKey, {
14-
useKeyboardJS,
15-
});
13+
const pressedKeys: boolean = useKeyPress(targetKey);
1614

1715
if (onKeydown === undefined) {
1816
onKeydown = onKeyup;

0 commit comments

Comments
Β (0)