Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 716 Bytes

README.md

File metadata and controls

23 lines (16 loc) · 716 Bytes

react-mousetrap Build Status npm version

React's high order component for Mousetrap integration.

Setup

Yarn install

yarn add react-mousetrap

Example

Create higher order component

    import mouseTrap from 'react-mousetrap';

    class YourComponent extends React.Component {
        componentWillMount {
            this.props.bindShortcut('right', this._goToNext);
        }
    }

    export default mouseTrap(BaseComponent);