1.1.6 • Published 2 years ago
@jdthornton/usekeypress v1.1.6
@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
}