Skip to content

Commit

Permalink
Fixed #2493 - DataTable issue related to restoreState with nextjs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcandu committed Dec 3, 2021
1 parent 8461882 commit a307133
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,6 @@ export class DataTable extends Component {
this.state.filters = props.filters;
}

if (this.isStateful()) {
this.restoreState(this.state);
}

this.attributeSelector = UniqueComponentId();

// header
Expand Down Expand Up @@ -1531,8 +1527,12 @@ export class DataTable extends Component {
this.createResponsiveStyle();
}

if (this.isStateful() && this.props.resizableColumns) {
this.restoreColumnWidths();
if (this.isStateful()) {
this.setState(this.restoreState(this.state));

if (this.props.resizableColumns) {
this.restoreColumnWidths();
}
}
}

Expand Down

0 comments on commit a307133

Please sign in to comment.