Skip to content

Commit 5cc7882

Browse files
committed
fix #1234
1 parent bfb2592 commit 5cc7882

File tree

1 file changed

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

1 file changed

+6
-0
lines changed

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

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

8787
UNSAFE_componentWillReceiveProps(nextProps) {
88+
if (nextProps.columns.filter(col => col.sort).length > 0 && !this.SortContext) {
89+
this.SortContext = createSortContext(
90+
dataOperator, this.isRemoteSort, this.handleRemoteSortChange);
91+
} else {
92+
this.SortContext = null;
93+
}
8894
if (!nextProps.pagination && this.props.pagination) {
8995
this.PaginationContext = null;
9096
}

0 commit comments

Comments
 (0)