Skip to content

conorhastings/react-close-on-escape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

👋

About

higher order component to close other react component on press of escape key (or fire whatever function you want but probably it should close)

Resources

Stars

Watchers

Forks

Packages

No packages published