How to use the react-widgets/lib/util/PropTypes.elementType function in react-widgets

To help you get started, we’ve selected a few react-widgets 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 jquense / react-widgets / packages / virtualized / src / VirtualList.js View on Github external
import ListOption from 'react-widgets/lib/ListOption'
import ListOptionGroup from 'react-widgets/lib/ListOptionGroup'
import { groupBySortedKeys } from 'react-widgets/lib/util/_'
import * as CustomPropTypes from 'react-widgets/lib/util/PropTypes'

export const virtualListPropTypes = {
  itemSizeEstimator: PropTypes.func,
  itemSizeGetter: PropTypes.func,
  pageSize: PropTypes.number,
  threshold: PropTypes.number,
  type: PropTypes.oneOf(['simple', 'variable', 'uniform']),
  useStaticSize: PropTypes.bool,
  useTranslate3d: PropTypes.bool,
  hasNextPage: PropTypes.bool,
  onRequestItems: PropTypes.func,
  loadingComponent: CustomPropTypes.elementType,
}

class VirtualList extends React.Component {
  static propTypes = {
    ...virtualListPropTypes,

    data: PropTypes.array,
    dataState: PropTypes.object,
    onSelect: PropTypes.func,
    onMove: PropTypes.func,

    activeId: PropTypes.string,
    optionComponent: CustomPropTypes.elementType,
    renderItem: PropTypes.func,
    renderGroup: PropTypes.func,
github jquense / react-widgets / packages / virtualized / src / VirtualList.js View on Github external
hasNextPage: PropTypes.bool,
  onRequestItems: PropTypes.func,
  loadingComponent: CustomPropTypes.elementType,
}

class VirtualList extends React.Component {
  static propTypes = {
    ...virtualListPropTypes,

    data: PropTypes.array,
    dataState: PropTypes.object,
    onSelect: PropTypes.func,
    onMove: PropTypes.func,

    activeId: PropTypes.string,
    optionComponent: CustomPropTypes.elementType,
    renderItem: PropTypes.func,
    renderGroup: PropTypes.func,

    focusedItem: PropTypes.any,
    selectedItem: PropTypes.any,

    isDisabled: PropTypes.func.isRequired,
    valueAccessor: PropTypes.func.isRequired,
    textAccessor: PropTypes.func.isRequired,

    disabled: CustomPropTypes.disabled.acceptsArray,

    messages: PropTypes.shape({
      emptyList: CustomPropTypes.message,
    }),
  }