Skip to content

Commit

Permalink
fix: pagination on sort (TanStack#2669)
Browse files Browse the repository at this point in the history
  • Loading branch information
anatha committed Oct 4, 2020
1 parent f847b0a commit f138292
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pagination.js
Expand Up @@ -65,8 +65,8 @@ export default class ReactTablePagination extends Component {
}

componentDidUpdate (prevProps, prevState) {
if (prevProps.page !== this.props.page && prevState.page !== this.state.page) {
// this is probably safe because we only update when old/new state.page are different
if (prevProps.page !== this.props.page || prevState.page !== this.state.page) {
// this is probably safe because we only update when old/new props/state.page are different
// eslint-disable-next-line react/no-did-update-set-state
this.setState({
page: this.props.page,
Expand Down

0 comments on commit f138292

Please sign in to comment.