facebookarchive / fixed-data-table

A React table component designed to allow presenting thousands of rows of data.
http://facebook.github.io/fixed-data-table/
Other
4.3k stars 553 forks source link

"manually calling a React.PropTypes validation function" warnings #449

Closed slashwhatever closed 8 years ago

slashwhatever commented 8 years ago

Just trying to run up a very basic example grid.

Code:


/* /components/FixedDataTableTest.jsx */

import React, {Component} from 'react';
import {Table, Column, Cell} from 'fixed-data-table';

class FixedDataTableTest extends Component {

    constructor(props) {
        super(props);
    }

    render() {

        // Table data as a list of array.
        const rows = [
            ['a1', 'b1', 'c1'],
            ['a2', 'b2', 'c2'],
            ['a3', 'b3', 'c3'],
        ];

        return (
            <Table
                rowHeight={50}
                rowsCount={rows.length}
                width={1000}
                height={500}
                {...this.props}>
                <Column
                    header={<Cell>Col 1</Cell>}
                    cell={<Cell>Column 1 static content</Cell>}
                    width={250}
                />
                <Column
                    header={<Cell>Col 3</Cell>}
                    cell={({rowIndex, ...props}) => (
                        <Cell {...props}>
                            Data for column 3: {rows[rowIndex][2]}
                        </Cell>
                    )}
                    width={250}
                />
            </Table>
        );
    }
}

export default FixedDataTableTest;

/* /GridTestApp.jsx */

import FixedDataTableTest from './components/FixedDataTableTest.jsx';
...
ReactDOM.render(
  <FixedDataTableTest />,
  document.getElementById('grid-element')
);
...

Over 100 errors in the console, all along these lines: https://puu.sh/qOUbt/1cd1d9ed7f.png