Skip to content

Commit c1d1d72

Browse files
committed
Merge branch 'daweifeng-master' into develop
2 parents 1aa4bbc + f534b30 commit c1d1d72

File tree

1 file changed

+3
-3
lines changed
  • packages/react-bootstrap-table2/src/contexts

1 file changed

+3
-3
lines changed

packages/react-bootstrap-table2/src/contexts/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ const withContext = Base =>
8585
}
8686

8787
UNSAFE_componentWillReceiveProps(nextProps) {
88-
if (nextProps.columns.filter(col => col.sort).length > 0 && !this.SortContext) {
88+
if (nextProps.columns.filter(col => col.sort).length <= 0) {
89+
this.SortContext = null;
90+
} else if (!this.SortContext) {
8991
this.SortContext = createSortContext(
9092
dataOperator, this.isRemoteSort, this.handleRemoteSortChange);
91-
} else {
92-
this.SortContext = null;
9393
}
9494
if (!nextProps.pagination && this.props.pagination) {
9595
this.PaginationContext = null;

0 commit comments

Comments
 (0)