3

I am using ReactTable component from react-table to display paginated data returned from my backend.

the backend returns an object as follows:

{count: (total items count), results: [items], pages_count:(number of pages), page:(current page) }

I want to set the total page count in ReactTable as the total page count returned by the backend and not as the length of the array of data. (rows returned by the backend corresponds only to the actual page). I tried to override the getPaginationProps prop, but I really did not find out how to do it correctly since I am new to react. Am I on the correct path ? and how can I do it ? Thank you

Akamee
  • 593
  • 1
  • 6
  • 21

1 Answers1

0

Please refer this blog for server side pagination related stuff with respect to react-table :

https://malithjayaweera.com/2018/01/reactjs-server-side-pagination/

joy08
  • 9,004
  • 8
  • 38
  • 73
  • Post answers should be properly formed answers, rather than links to external sources. Ideally, links should only be included for reference. – Mauro Colella Apr 04 '23 at 07:50