Skip to content

Instantly share code, notes, and snippets.

@TimeSmash
Created November 20, 2019 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TimeSmash/f63ce42903828e668740b039a19e48c4 to your computer and use it in GitHub Desktop.
Save TimeSmash/f63ce42903828e668740b039a19e48c4 to your computer and use it in GitHub Desktop.
Composing our ReactPaginate component and organizing its parts in a logistical way
<ReactPaginate id="react-paginate"
// labels
previousLabel={'Previous'}
nextLabel={'Next'}
breakLabel={'…'}
// classNames
containerClassName={'react-paginate'}
previousClassName={'previous'}
breakClassName={'break-me'}
nextClassName={'next'}
pageClassName={'page'}
activeClassName={'active'}
pageLinkClassName={'page-link'}
disabledClassName={'disabled'}
// functionality
pageCount={this.state.drinkAndPageInfo.page_count} //total pages
marginPagesDisplayed={2}
pageRangeDisplayed={5}
forcePage={5}
onPageChange={(event) => {this.handlePageClick(event)} /*Fxn when page clicked*/}
disableInitialCallback={true}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment