0.2.1 • Published 8 years ago

react-hotkey-hoc v0.2.1

Weekly downloads
116
License
MIT
Repository
github
Last release
8 years ago

react-hotkey-hoc

THIS IS MY HOTKEY HOC. THERE ARE MANY LIKE IT, BUT THIS ONE IS MINE.

##Installation npm i -S react-hotkey-hoc

What's it do

This is a simple little higher-order component (HOC) for using mousetrap with react. You give it a keymap of shortcuts & it bind it to the mousetrap singleton. The, it'll unbind it when the component unmounts. No mixins, no context, no JSX wrappers, no problems.

##Usage

Stick it around your component that needs some hot keys

import {hotkey} from 'redux-hotkey-hoc';
@hotkey(keymap)
class App extends Component {
  ...
}

License

MIT