Skip to content

Manual Pagination doesn't update table.getRowModel().rows - it shows all results #4917

@luciodale

Description

@luciodale

Describe the bug

I was looking at the manual pagination example here:
https://tanstack.com/table/v8/docs/examples/react/pagination-controlled and noticed that the pagination is happening at the query level.

When trying to add the pagination client side, the logic seems to work properly, but the content doesn't update based on the new pagination values. A reproducible example is here:
https://codesandbox.io/p/sandbox/boring-wilbur-fqkd7r?embed=1&file=%2Fsrc%2Fmain.tsx%3A79%2C37-82%2C6

My default pagination object looks like this:

{
      pageIndex: 0,
      pageSize: 10
}

but the table shows 100 results. if I change the visible rows from the dropdown in the UI or change the page, the table always shows the whole payload vs paginated results.

Am I actually supposed to slice the data myself off table.getRowModel().rows?

Your minimal, reproducible example

https://codesandbox.io/p/sandbox/boring-wilbur-fqkd7r?embed=1&file=%2Fsrc%2Fmain.tsx%3A79%2C37-82%2C6

Steps to reproduce

Just load the UI and see the data is not being paginated

Expected behavior

Table should only show 10 items as per the default object

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

whatever codesandbox is running on

react-table version

v8.9.2

TypeScript version

No response

Additional context

No response

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions