Skip to content

Commit 3fe8c26

Browse files
Simple type fix in useKeyPress
1 parent c17f888 commit 3fe8c26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pages/useKeyPress.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function App() {
4040
// Hook
4141
function useKeyPress(targetKey) {
4242
// State for keeping track of whether key is pressed
43-
const [keyPressed, setKeyPressed] = useState(false);
43+
const [keyPressed, setKeyPressed] = useState<boolean>(false);
4444
// If pressed key is our target key then set to true
4545
function downHandler({ key }) {
4646
if (key === targetKey) {

0 commit comments

Comments
 (0)