How to use the react-onclickoutside.IGNORE_CLASS_NAME.slice function in react-onclickoutside

To help you get started, we’ve selected a few react-onclickoutside examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / react-onclickoutside_v6.x.x / flow_v0.57.1-v0.88.0 / test_react-onclickoutside_v6.x.x.js View on Github external
//@flow

import React from 'react';
import onClickOutside, { IGNORE_CLASS_NAME } from 'react-onclickoutside';

IGNORE_CLASS_NAME.slice();

// $ExpectError Cannot perform arithmetic operation because string literal `ignore-react-onclickoutside` [1] is not a number.
IGNORE_CLASS_NAME - 1;

// class and const are in same line to make all flow versions unhappy in the same line.
// $ExpectError Cannot call `onClickOutside` because string [1] is incompatible with boolean [2].
class FailComponent extends React.Component&lt;{ preventDefault: string }&gt; {render() {return <div>;}} const FailComponentWithClickOutside = onClickOutside(FailComponent);
;

class A extends React.Component&lt;{a: string, preventDefault: boolean }&gt; {
  render() {
    return this.props.preventDefault ? <div>{this.props.a}</div> : null;
  }
}

const B = onClickOutside(A);</div>

react-onclickoutside

An onClickOutside wrapper for React components

MIT
Latest version published 5 months ago

Package Health Score

81 / 100
Full package analysis