React-data-grid: React Data Grid PropType is null error () with React version 16.0.0

Created on 20 Oct 2017  路  5Comments  路  Source: adazzle/react-data-grid

Having an issue with setting up a simple react-data-grid example i saw @addazle
i copied and pasted the code below from the source page
const ReactDataGrid = require('react-data-grid');
const React = require('react');

class Example extends React.Component {
constructor(props, context) {
super(props, context);
this.createRows();
this._columns = [
{ key: 'id', name: 'ID' },
{ key: 'title', name: 'Title' },
{ key: 'count', name: 'Count' } ];

this.state = null;

}

createRows = () => {
let rows = [];
for (let i = 1; i < 1000; i++) {
rows.push({
id: i,
title: 'Title ' + i,
count: i * 1000
});
}

this._rows = rows;

};

rowGetter = (i) => {
return this._rows[i];
};

render() {
return (
columns={this._columns}
rowGetter={this.rowGetter.bind(this)}
rowsCount={this._rows.length}
minHeight={500} />);
}
}

but i get this error when i run the react application
Uncaught TypeError: Cannot read property 'number' of undefined

react-data-grid_error

i tried to debug the issue with console.log(_react) and console.log(_react2)
the console.log revealed that the PropType property does not exist on the two objects
_react or _react2
am using the latest Chrome browser.
hope i can get the issue fixed as asap.
thanks

Most helpful comment

hey @kwkau -- we're hoping to support React 16 in a future release, but for now (as mentioned in the Issue Template) we are not officially supporting it.

we'll merge the PropTypes migration PR mentioned above in when we can. Until then if you really really need to use React 16 immediately, you can use the temporary workaround detailed here

All 5 comments

954 will fix this issue.

patiently waiting @pankajpatel

@kwkau me as well, development is on pause.

hey @kwkau -- we're hoping to support React 16 in a future release, but for now (as mentioned in the Issue Template) we are not officially supporting it.

we'll merge the PropTypes migration PR mentioned above in when we can. Until then if you really really need to use React 16 immediately, you can use the temporary workaround detailed here

thanks, you just saved my ass big time

Was this page helpful?
0 / 5 - 0 ratings

Related issues

martinnov92 picture martinnov92  路  3Comments

alvaro1728 picture alvaro1728  路  4Comments

soma83 picture soma83  路  4Comments

oliverwatkins picture oliverwatkins  路  4Comments

GenoD picture GenoD  路  3Comments