react-close-on-escape

close react component on press escape

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
react-close-on-escape
3.0.04 years ago6 years agoMinified + gzip package size for react-close-on-escape in KB

Readme

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

:wave: