From 1e76ca9bdbffde2e1027a127e5d308c0e21f634d Mon Sep 17 00:00:00 2001 From: AllenFang Date: Fri, 21 Sep 2018 16:27:10 +0800 Subject: [PATCH] fix row-pure-content will not update in some case --- packages/react-bootstrap-table2/src/row/row-pure-content.js | 6 ++---- packages/react-bootstrap-table2/src/row/should-updater.js | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/react-bootstrap-table2/src/row/row-pure-content.js b/packages/react-bootstrap-table2/src/row/row-pure-content.js index 52b77f0..cd1cbfd 100644 --- a/packages/react-bootstrap-table2/src/row/row-pure-content.js +++ b/packages/react-bootstrap-table2/src/row/row-pure-content.js @@ -7,10 +7,8 @@ import Cell from '../cell'; export default class RowPureContent extends React.Component { shouldComponentUpdate(nextProps) { - if (typeof this.props.shouldUpdate !== 'undefined') { - if (nextProps.shouldUpdate === this.props.shouldUpdate) { - return false; - } + if (typeof nextProps.shouldUpdate !== 'undefined') { + return nextProps.shouldUpdate; } return true; } diff --git a/packages/react-bootstrap-table2/src/row/should-updater.js b/packages/react-bootstrap-table2/src/row/should-updater.js index 355c7d7..f99ff08 100644 --- a/packages/react-bootstrap-table2/src/row/should-updater.js +++ b/packages/react-bootstrap-table2/src/row/should-updater.js @@ -23,8 +23,8 @@ export default ExtendBase => const shouldUpdate = this.props.rowIndex !== nextProps.rowIndex || this.props.editable !== nextProps.editable || - !_.isEqual(this.props.row, nextProps.row || - this.props.columns.length !== nextProps.columns.length); + !_.isEqual(this.props.row, nextProps.row) || + this.props.columns.length !== nextProps.columns.length; return shouldUpdate; }