Skip to content

⌨️ A simple Mousetrap hook for handling keyboard shortcuts in React.

License

Notifications You must be signed in to change notification settings

VienDinhCom/use-mousetrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

useMousetrap

A simple Mousetrap hook for handling keyboard shortcuts in React.

Installation

yarn add use-mousetrap
npm install --save use-mousetrap

Usage

import { useMousetrap } from 'use-mousetrap';

useMousetrap('ctrl+enter', () => {
  console.log('Squeek! Squeek!');
});

For more details, you can read the Mousetrap documentation.