@alobato/use-key-press

1.0.0 • Public • Published

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()

Readme

Keywords

Package Sidebar

Install

npm i @alobato/use-key-press

Weekly Downloads

19

Version

1.0.0

License

MIT

Unpacked Size

2.91 kB

Total Files

4

Last publish

Collaborators

  • alobato