Permalink
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (12 sloc) 381 Bytes

<OutsideClick>

Tracks clicks outside its children.

Usage

import {OutsideClick} from 'libreact/lib/OutsideClick';

<OutsideClick onClick={}>
  <div>Don't click here.</div>
</OutsideClick>

Props

  • onClick — event called when user click outside of its children.
  • event — optional, string, event name subscribe to, defaults to mousedown.