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.
1 parent c17f888 commit 3fe8c26Copy full SHA for 3fe8c26
src/pages/useKeyPress.md
@@ -40,7 +40,7 @@ function App() {
40
// Hook
41
function useKeyPress(targetKey) {
42
// State for keeping track of whether key is pressed
43
- const [keyPressed, setKeyPressed] = useState(false);
+ const [keyPressed, setKeyPressed] = useState<boolean>(false);
44
// If pressed key is our target key then set to true
45
function downHandler({ key }) {
46
if (key === targetKey) {
0 commit comments