/react-external-click

Simple react component to capture external click events.

Primary LanguageJavaScriptMIT LicenseMIT

⚠️ Deprecated ⚠️

You should use react-trap with better options and flexibility


react-external-click

Capturing clicks outside your component.

External clicks example

You can pass it a render-prop or children as function (more details).

import React, { Component } from 'react';
import ExternalClick from 'ExternalClick';

class App extends Component {
  render() {
    return (
      <div>
        <ExternalClick render={Item} />
        
        <ExternalClick>
          {isExternalClick => (<Menu show={!isExternalClick} />)}
        </ExternalClick>
      </div>
    );
  }
}