@alobato/use-key-press
v1.0.0
Published
React hook to detect key press
Downloads
4
Readme
useKeyPress
React hook to detect key press
Note: This is using the new React Hooks API
You'll need to install
react
,react-dom
, etc at^16.8.0
or above
Install
yarn add @alobato/use-key-press
Usage
import useKeyPress from '@alobato/use-key-press'
...
const escPress = useKeyPress('Escape')
if (escPress) handleExit()