Make paginationPage an optional, controllable property
- add paginationPage property to DataTable
- call handleChangePage when paginationPage changes
- maintain existing pagination controls and actions
I was looking for a way to reset the table back to the first page, and I was not happy with the way that paginationResetDefaultPage works. I prefer using a value/onValueChanged pattern so I would like to add a paginationPage property to control which page is selected when using either client-side or server-side pagination. It's expected that paginationPage and onChangePage are used together and kept in sync so that the pagination controls and actions still work:
const [page, setPage] = useState(1);
<DataTable
data={data}
columns={columns}
pagination
paginationPage={page}
onChangePage={setPage}
/>
Deploy Preview for react-data-table-component ready!
| Name | Link |
|---|---|
| Latest commit | caf564b43b41e5858c03a592bff5c42494c84771 |
| Latest deploy log | https://app.netlify.com/sites/react-data-table-component/deploys/625d845ece99ee0008c59aef |
| Deploy Preview | https://deploy-preview-1037--react-data-table-component.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Any release date?
Looking great!
ERA for merge?