We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9aea72c + a702914 commit a9451f8Copy full SHA for a9451f8
packages/example/src/hooks/useKey.ts
@@ -10,12 +10,10 @@ import { SupportedKeys } from '../components/remote-control/SupportedKeys';
10
export const useKey = (key: SupportedKeys, callback: (pressedKey: SupportedKeys) => boolean) => {
11
useEffect(() => {
12
const remoteControlListener = (actualKey: SupportedKeys) => {
13
- if (actualKey !== key) return;
+ if (actualKey !== key) return false;
14
return callback(key);
15
};
16
- // @ts-expect-error TODO fix the type error
17
RemoteControlManager.addKeydownListener(remoteControlListener);
18
19
return () => RemoteControlManager.removeKeydownListener(remoteControlListener);
20
}, [key, callback]);
21
0 commit comments