Skip to content
This repository was archived by the owner on Jan 15, 2022. It is now read-only.
This repository was archived by the owner on Jan 15, 2022. It is now read-only.

Re-render is broken when pagination is on but no currentPage is specified #280

@slestang

Description

@slestang

The PR #272 seems to have broken the refresh of a Table without a currentPage set.
On re-render, I get the error:

Must pass a currentPage argument to Paginator

If I set currentPage={0} on Table the error disappear.
It was working with version 0.13.0

What I understood:
When componentWillReceiveProps is called, currentPage is null, so updateCurrentPage is called with null:

updateCurrentPage(nextPage) {
    if (nextPage !== this.state.currentPage) { // null !== 0
        this.setState({ currentPage: nextPage});
    }
}

So currentPage is setted with null in the state and the error is thrown by Paginator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions