From 048003ffc3c8183da2ddae73a5261400f0ce9662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20DELFOUR?= Date: Tue, 10 Oct 2017 10:57:30 +0200 Subject: [PATCH] Fix: Cannot read property 'type' of undefined Uncaught TypeError: Cannot read property 'type' of undefined at BootstrapTable.js:228 at forEachSingleChild (ReactChildren.js:49) at traverseAllChildrenImpl (traverseAllChildren.js:75) at traverseAllChildrenImpl (traverseAllChildren.js:91) at traverseAllChildren (traverseAllChildren.js:170) at Object.forEachChildren [as forEach] (ReactChildren.js:69) at BootstrapTable.initTable (BootstrapTable.js:221) at BootstrapTable.initTable (createPrototypeProxy.js:44) at BootstrapTable.componentWillReceiveProps (BootstrapTable.js:419) at BootstrapTable.componentWillReceiveProps (createPrototypeProxy.js:44) --- src/BootstrapTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapTable.js b/src/BootstrapTable.js index 042d01545..abf7c4e07 100644 --- a/src/BootstrapTable.js +++ b/src/BootstrapTable.js @@ -62,7 +62,7 @@ class BootstrapTable extends Component { const nextDataFields = React.Children.map(props.children, column => column.props.dataField); React.Children.forEach(this.props.children, column => { const { dataField, filter } = column.props; - if (!nextDataFields.includes(dataField)) { + if (filter && !nextDataFields.includes(dataField)) { // Clear filter this.filter.handleFilter(dataField, '', filter.type, filter); }