Skip to content

Clean way to handle pagination.pageCount, remove it from state? #3902

Answered by tannerlinsley
colindjk asked this question in General
Discussion options

You must be logged in to vote

Technically, the page count is state, or in other words, a persisted variable in the table instance that changes over time. It's either provided by the user or derived automatically. We'll have better docs around this soon, but I think the following should help:

  • Manually controlling pagination?
    • If you know the page count, provide it to options.state.pagination.pageCount (-1 if it is unknown)
  • Using client-side pagination?
    • Provide only your data

In both cases, use instance.getPageCount() to get the page count (the table will know whether to pass the state through or derive it automatically)

Note: I just released a new version that polishes this experience a bit more. Please give it…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tannerlinsley
Comment options

@colindjk
Comment options

Answer selected by colindjk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants