diff --git a/packages/react-bootstrap-table2/src/contexts/row-expand-context.js b/packages/react-bootstrap-table2/src/contexts/row-expand-context.js index 6ba6b9589..9c038ab5f 100644 --- a/packages/react-bootstrap-table2/src/contexts/row-expand-context.js +++ b/packages/react-bootstrap-table2/src/contexts/row-expand-context.js @@ -23,10 +23,10 @@ class RowExpandProvider extends React.Component { } handleRowExpand = (rowKey, expanded, rowIndex, e) => { - if (this.props.expandRow.nonExpandable.includes(rowKey)) { + const { data, keyField, expandRow: { onExpand, onlyOneExpanding, nonExpandable } } = this.props; + if (nonExpandable && nonExpandable.includes(rowKey)) { return; } - const { data, keyField, expandRow: { onExpand, onlyOneExpanding } } = this.props; let currExpanded = [...this.state.expanded];