How to use the prop-types-extra.isRequiredForA11y 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 / Menu.react.js View on Github external
...style,
          display: 'block',
          maxHeight,
          overflow: 'auto',
        }}>
        {contents}
      
    );
  }
}

Menu.propTypes = {
  /**
   * Needed for accessibility.
   */
  id: isRequiredForA11y(PropTypes.oneOfType([
    PropTypes.number,
    PropTypes.string,
  ])),
  /**
   * Maximum height of the dropdown menu.
   */
  maxHeight: PropTypes.string,
};

Menu.defaultProps = {
  maxHeight: '300px',
};

Menu.Divider = (props) => (
  <li role="separator">
);</li>