How to use the prop-types-extra.componentOrElement.isRequired function in prop-types-extra

To help you get started, we’ve selected a few prop-types-extra 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 ericgio / react-bootstrap-typeahead / src / Overlay.react.js View on Github external
_update = () => {
    const {className, container, show} = this.props;

    if (!(show && isBody(container))) {
      return;
    }

    // Set a classname on the body for scoping purposes.
    container.classList.add(BODY_CLASS);
    !!className && container.classList.add(...className.split(' '));
  }
}

Overlay.propTypes = {
  children: PropTypes.element,
  container: componentOrElement.isRequired,
  onMenuHide: PropTypes.func,
  onMenuShow: PropTypes.func,
  onMenuToggle: PropTypes.func,
  referenceElement: componentOrElement,
  show: PropTypes.bool,
};

Overlay.defaultProps = {
  onMenuHide: noop,
  onMenuShow: noop,
  onMenuToggle: noop,
  show: false,
};

export default Overlay;