Skip to content

Commit 8c820ce

Browse files
committed
fix(useKeyboardJs): fix argument type error
1 parent a53c8c5 commit 8c820ce

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/useKeyboardJs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ yarn add keyboardjs
3737
## Reference
3838

3939
```js
40-
useKeyboardJs(combination: string): [isPressed: boolean, event?: KeyboardEvent]
40+
useKeyboardJs(combination: string | string[]): [isPressed: boolean, event?: KeyboardEvent]
4141
```

src/useKeyboardJs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect, useState } from 'react';
22
import useMount from './useMount';
33

4-
const useKeyboardJs = (combination: string) => {
4+
const useKeyboardJs = (combination: string | string[]) => {
55
const [state, set] = useState<[boolean, null | KeyboardEvent]>([false, null]);
66
const [keyboardJs, setKeyboardJs] = useState<any>(null);
77

0 commit comments

Comments
 (0)