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
$3
``js
import {hotkey} from 'redux-hotkey-hoc';
@hotkey(keymap)
class App extends Component {
...
}
``
License
MIT