Nondigestible Purple Mayonnaise

npm

Need private packages and team management tools?Check out npm Orgs. »

react-mousetrap

0.2.0 • Public • Published

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 {
    /*your implementation */

    componentWillMount {
        this.props.bindShortcut('right', this._goToNext);
    }

    _goToNext() {
        this.props.unbindShortcut('right');
    }
}

export default mouseTrap(BaseComponent);

install

npm i react-mousetrap

Downloadsweekly downloads

2,216

version

0.2.0

license

SEE LICENSE IN LICENSE

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability