Pagination component made using Reactstrap PaginationItem and PaginationLink components.
PaginationComponent.propTypes = {
// Total number of items
totalItems: PropTypes.number.isRequired,
// Number of items displayed each page
pageSize: PropTypes.number.isRequired,
// Function to receive the event when a page is selected
onSelect: PropTypes.func.isRequired,
// Number of pages being displayed, by default 5
maxPaginationNumbers: PropTypes.number,
// Page where the pagination starts, by default 1
activePage: PropTypes.number
}
<PaginationComponent totalItems={50} pageSize={5} onSelect={this.handleSelected} />
Now if the props change the component will update. (Thanks JaydeeSale!)
Added prop activePage to have a different start page. (Thanks JalalAlbasri!)