Skip to content

Commit

Permalink
Fixed #440
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Jun 8, 2018
1 parent c61d5e2 commit c86ce0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/treetable/TreeTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,9 @@ export class TreeTable extends Component {
static getDerivedStateFromProps(nextProps, prevState) {
let state = {};

if (nextProps.sortField !== prevState.sortField) { state = {...state, ...{sortField: nextProps.sortField}} }
if (nextProps.sortOrder !== prevState.sortOrder) { state = {...state, ...{sortOrder: nextProps.sortOrder}} }
if (nextProps.multiSortMeta !== prevState.multiSortMeta) {state = {...state, ...{multiSortMeta: nextProps.multiSortMeta}} }
if (nextProps.sortField && nextProps.sortField !== prevState.sortField) { state = {...state, ...{sortField: nextProps.sortField}} }
if (nextProps.sortOrder && nextProps.sortOrder !== prevState.sortOrder) { state = {...state, ...{sortOrder: nextProps.sortOrder}} }
if (nextProps.multiSortMeta && nextProps.multiSortMeta !== prevState.multiSortMeta) {state = {...state, ...{multiSortMeta: nextProps.multiSortMeta}} }

if(Object.keys(state).length > 0)
return state;
Expand Down

0 comments on commit c86ce0e

Please sign in to comment.