How to use the react-virtualized.Table.propTypes function in react-virtualized

To help you get started, we’ve selected a few react-virtualized 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 Skyscanner / backpack / packages / bpk-component-datatable / src / BpkDataTable.js View on Github external
render() {
    if (this.props.width !== null) {
      return this.renderTable(this.props.width);
    }

    return (
      
        {({ width }) => this.renderTable(width)}
      
    );
  }
}

BpkDataTable.propTypes = {
  ..._omit(Table.propTypes, omittedTableProps),
  rows: PropTypes.arrayOf(Object).isRequired,
  children: hasChildrenOfType(BpkDataTableColumn),
  width: PropTypes.number,
  headerHeight: PropTypes.number,
  className: PropTypes.string,
  defaultColumnSortIndex: PropTypes.number,
};

BpkDataTable.defaultProps = {
  ...Table.defaultProps,
  width: null,
  headerHeight: 60,
  rowHeight: 60,
  gridStyle: { direction: undefined }, // This is required for rows to automatically respect rtl
  defaultColumnSortIndex: 0,
};
github GSS-FED / vital-ui-kit-react / packages / table / src / SimpleTable / SimpleTable.jsx View on Github external
// @flow

import * as React from 'react';
import styled from 'styled-components';
import {
  type TableProps,
  Table as BaseTable,
} from 'react-virtualized';
import '../style.css';
import defaultRowRenderer from './defaultRowRenderer';
import defaultHeaderRowRenderer from './defaultHeaderRowRenderer';

/* eslint-disable react/forbid-foreign-prop-types */
BaseTable.propTypes.children = () => {};
/* eslint-enable */

const StyledTable: React.ComponentType = styled(
  BaseTable,
)``;

type Props = TableProps & {
  hasHorizontalBorder?: boolean,
  striped?: boolean,
};

class SimpleTable extends React.Component {
  static defaultProps = {
    ...BaseTable.defaultProps,
    rowRenderer: defaultRowRenderer,
    headerRowRenderer: defaultHeaderRowRenderer,