Skip to content

telecta/react-mousetrap

Repository files navigation

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