@jdthornton/usekeypress
v1.1.6
Published
React keypress hook
Downloads
3
Readme
@jdthornton/usekeypress
React keypress hook.
Install
$ npm install @jdthornton/usekeypress
Usage
import useKeyPress from "@jdthornton/usekeypress";
function App({ isListening, handleClose }){
// Listens for an 'ESC' key press event if isListening is true
useKeyPress(isListening ? handleClose : null, 27)
return null
}