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 (
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
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
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
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