react-close-on-escape
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/react-close-on-escape package

3.0.0 • Public • Published

React Close On Escape

Simple HOC to close enclosed react component on press of escape key (or really call on any function but please use for closing thank you)

use

npm install react-close-on-escape --save

import CloseOnEscape from 'react-close-on-escape';
 
const Component = ({ onEscape }) => <CloseOnEscape onEscape={onEscape}><span>some stuff here</span></CloseOnEscape>;

👋

Package Sidebar

Install

npm i react-close-on-escape

Weekly Downloads

465

Version

3.0.0

License

MIT

Unpacked Size

4.87 kB

Total Files

5

Last publish

Collaborators

  • conorhastings