JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 498608
  • Score
    100M100P100Q181408F
  • License MIT

React Outside Click Handler

Package Exports

  • react-outside-click-handler

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-outside-click-handler) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-outside-click-handler

Build Status Coverage Status

React Component for handling some specific component outside click

Table of contents

Installation

yarn add react-outside-click-handler

API

  • <OutsideClickHandler onOutsideClick useCapture />

props

Example

class Example extends React.Component {
  constructor(props) {
    super(props);
    this.handleOutsideClick = this.handleOutsideClick.bind(this);
  }

  handleOutsideClick() {
    // ...
  }

  render() {
    return (
      <div>
        <TodoList>
          <Todo />
          ...
        </TodoList>
        <OutsideClickHandler onOutsideClick={this.handleOutsideClick}>
          <InsideComponent />
        </OutsideClickHandler>
      </div>
    );
  }
}

Development

yarn start

Then, Go to http://localhost:3000

Credits

This component is inspired by airbnb/react-dates's OutsideClickHandler

Licence

MIT @ Taehwan, No (taehwanno)