npm.io
1.0.1 • Published 8 years ago

tsr-click-outside

Licence
MIT
Version
1.0.1
Deps
2
Vulns
0
Weekly
0
Stars
2

tsrClickOutside

detect click outside a component based on Typescript React

Demo:

npm install
npm start
access http://localhost:8080

Usage:

import { ClickOutside } from "${your path}";
<ClickOutside wrapperElement="div" className="click-zone" onClickOutside={} onClick={}>
  <div className="demo">
      Inside
  </div>
</ClickOutside>

API

wrapperElement: string, optional, default "div", the wrapper element type for component.
className: string, optional, class for component wrapper.
onClickOutside: fun, optional, the function excute after clikc outside the component.
onClick: fun, optional, the function excute after clikc inside the component.