Skip to content

table.setPageCount is not updating pageCount #4918

@lakshmanang

Description

@lakshmanang

Describe the bug

table.setPageCount not updating pageCount.

const table = useReactTable({
   data: dataQuery.data?.rows ?? defaultData,
   columns,
   pageCount:  10,
   state: {
     pagination,
   },
   onPaginationChange: setPagination,
   getCoreRowModel: getCoreRowModel(),
   manualPagination: true,
   // getPaginationRowModel: getPaginationRowModel(), // If only doing manual pagination, you don't need this
   debugTable: true,
 })
React.useEffect(() => {
   console.log("asdfasdf");
   table.setPageCount(20)
 },[])

Actual result:
console.log(table.getPageCount()); // 10

Please suggest a way to change pageCount.

Your minimal, reproducible example

Not available

Steps to reproduce

1.Set pageCount=10 in useReactTableOptions
2. change pageCount somewhere outside by table.setPageCount(20)

Expected behavior

Expected result:

console.log(table.getPageCount()); // 20

How often does this bug happen?

None

Screenshots or Videos

image image

Platform

windows 11, Chrome

react-table version

^8.8.4

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