fix row-pure-content will not update in some case

This commit is contained in:
AllenFang 2018-09-21 16:27:10 +08:00
parent fa13550d8c
commit 1e76ca9bdb
2 changed files with 4 additions and 6 deletions

View File

@ -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;
}

View File

@ -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;
}