DEV Community

Discussion on: Create Pagination component from scratch in ReactJS

Collapse
 
tegadaniel profile image
Philip Daniel Oghenetega

For the pageDecrement, you can add "&& currentPage > pages[0]" to not show the &hellip at the first page.

let pageDecrementBtn = null;

if (pages.length > maxPageNumberLimit && currentPage > pages[0]) {

pageDecrementBtn =

  • ;

    }