A Simple And Flexible Pagination For Data Tables. $ npm install react-pro-mod-pagination --save
import ProModPaginate,{getPaginatedData} from 'react-pro-mod-pagination';
Use getPaginatedData helper function to get paginated Data.
Name | Type | Description |
---|---|---|
pageSize |
Number |
Required. The total items per page. |
DataArray |
Array |
Required. Table Data Array. |
currentPage |
Number |
Required. Current Page margins. |
handleChangeCurrentPage |
Fun |
function for handling current page. |
import ProModPaginate,{getPaginatedData} from './ProModPaginate'
function TestTable() {
let data=[....]
........
const handlePage=(value)=>{
setState({currentPage:value})
let paginatedData=getPaginatedData(data,4,value)
setState({paginatedData})
}
<ProModPaginate
currentPage={state.currentPage}
handleChangeCurrentPage={handlePage}
pageSize={4} DataArray={data}
/>
}
-->Katragadda Sriharsha.