React throwing Warning: Unkown Props
I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/adazzle/react-data-grid/blob/master/CONTRIBUTING.md
Current behavior I'm on React version 0.14.8 and on initializing the data grid as given here, I get the following errors in the console:
VM3181:27 Warning: Unknown props `enableCellSelect`, `columns`, `rowGetter`, `rowsCount`, `minHeight`, `onRowUpdated`, `minColumnWidth`, `columnEquality`, `rowHeight`, `enableRowSelect`, `rowKey`, `rowScrollTimeout`, `cellNavigationMode`, `headerRows`, `columnMetrics`, `cellMetaData`, `selectedRows`, `rowSelection`, `expandedRows`, `rowOffsetHeight`, `sortColumn`, `sortDirection`, `onSort`, `totalWidth`, `onViewportKeydown`, `onViewportKeyup`, `onViewportDragStart`, `onViewportDragEnd`, `onViewportDoubleClick`, `onColumnResize` on <div> tag. Remove these props from the element. For details, see https://fb.me/react-unknown-prop
in div (created by Grid)
in Grid (created by ReactDataGrid)
in div (created by ReactDataGrid)
in div (created by ReactDataGrid)
in ReactDataGrid (created by UploadCsv)
in div (created by UploadCsv)
in UploadCsv
This is just one of the many similar warnings I'm getting
Here's how I'm initializing the grid -
<ReactDataGrid
enableCellSelect={true}
columns={columns}
rowGetter={this.rowGetter}
rowsCount={this.state.rows.length}
minHeight={500}
onRowUpdated={this.handleRowUpdated} />
Expected/desired behavior
Reproduction of the problem If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem.
What is the expected behavior? The error is thrown multiple times for different props. None of the errors should be there.
What is the motivation / use case for changing the behavior?
@FauzanKhan Thanks for that. We'll take a look
I am getting the same error but on react 15.2.1
Same error here on react 15.3.1
Same error here on react 15.0.2
Seems to be this line:
https://github.com/adazzle/react-data-grid/blob/ac42cb60dba24a3b95c28e726bd5f0589a1c1045/src/Grid.js#L84
https://github.com/adazzle/react-data-grid/blob/master/src/Row.js#L205
@malonecj hay! It's been a month ago still the same problem in last version, any progress?.. =)
Any news?
hi, any new status on this issue. A great table manager BTW!
same thing here with react 15.3.2
still here on react-data-grid v1.0.44 https://github.com/adazzle/react-data-grid/pull/457 @richardware @malonecj
I've proposed #468 to remove the div props, but tests have started failing. There are also warnings:
Warning: ReactDOMComponent: Do not access .props of a DOM node; instead, recreate the props as
renderdid originally or read the DOM properties/attributes directly from this node (e.g., this.refs.box.className).
Does react-data-grid rely on these div properties?
any news here ?
Alternatively, you can work around this by filtering out the warning in dev builds:
let originalConsoleError = null;
// Patch console.error to ignore all errors that match the pattern given.
function ignoreConsoleErrors(pattern) {
originalConsoleError = console.error;
console.error = function(...args) {
let message = null;
if (_.isString(args[0])) {
message = args[0];
}
// Skip the message if it matches.
if (message && message.match(pattern)) {
return;
}
// Otherwise, continue to console.error as normal.
return originalConsoleError.apply(console, args);
};
}
function restoreConsoleError() {
console.error = originalConsoleError;
}
const NodeViewer = React.createClass({
componentWillMount() {
if (process.env.NODE_ENV == "dev") {
// Work around https://github.com/adazzle/react-data-grid/issues/418
ignoreConsoleErrors(/^Warning: Unknown props [\s\S]*created by ReactDataGrid/);
}
},
componentWillUnmount() {
if (process.env.NODE_ENV == "dev") {
restoreConsoleError();
}
},
render() {
// ... use a react-data-grid
}
});
+1
@Wilfred Thanks so much for the temporary workaround! To be safe we can be more specific with the match:
ignoreConsoleErrors(/^Warning: Unknown props [\s\S]* on <div> tag[\s\S]*created by ReactDataGrid/);
Also apparently process.env.NODE_ENV !== "production" is the common nomenclature!
Is anyone working on this? I see only closed PRs. Would be great to know if this is a long way off or if you still need a PR-fix
Any update on this. I am facing same problem
Same here, can't make it work at all :(
Still have the warnings
Fixed in #528