Skip to content

Commit a9451f8

Browse files
authored
Merge pull request #186 from stavfx/patch-1
Fix type error in useKey
2 parents 9aea72c + a702914 commit a9451f8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/example/src/hooks/useKey.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ import { SupportedKeys } from '../components/remote-control/SupportedKeys';
1010
export const useKey = (key: SupportedKeys, callback: (pressedKey: SupportedKeys) => boolean) => {
1111
useEffect(() => {
1212
const remoteControlListener = (actualKey: SupportedKeys) => {
13-
if (actualKey !== key) return;
13+
if (actualKey !== key) return false;
1414
return callback(key);
1515
};
16-
// @ts-expect-error TODO fix the type error
1716
RemoteControlManager.addKeydownListener(remoteControlListener);
18-
// @ts-expect-error TODO fix the type error
1917
return () => RemoteControlManager.removeKeydownListener(remoteControlListener);
2018
}, [key, callback]);
2119
};

0 commit comments

Comments
 (0)