View Code? Open in Web Editor
NEW
A simple react data paginator
License: MIT License
HTML 89.81%
JavaScript 9.43%
SCSS 0.69%
Shell 0.07%
react-paginator's Introduction
I am Patrick, currently building software for Native Instruments. My current job is helping me explore technologies around music and shipping music tech to users.
I am currently working a lot with Python and GCP
Give my open source packages(React Paginator and React multi image upload ) a try, you might love them. ๐
Reach me on [email protected] or contact me through my portfolio
react-paginator's People
react-paginator's Issues
In this line the assignment going to be done to empty Array
I recommend to remove the variable assignment from above and move it to the following line
pages = range ( startPage , endPage ) ;
Basically
let pages = range(startPage, endPage);
which might save small tiny amount of render ๐
Hi,
Is there any scope for the Next/Prev buttons could be configurable? It would offer great flexibility to have the option to turn on/off, and possibly add extra classes, to these two buttons as currently the only configuration is their text.
First Image with paginator and second image without paginator.
Warning: Received true
for a non-boolean attribute next
.
My code
<Paginator totalRecords={totalDocs} pageLimit={pageLimit} pageNeighbours={2} setOffset={() => {}} currentPage={currentPage} setCurrentPage={setCurrentPage} />
When the current page is 1, the Next button does not work. It works on all other pages.
Hi! I was using this lib with Nextjs and I noticed that if the user requests a page like this:
localhost:3000/products?page=2
page=2
is loaded and then immediately setCurrentPage(1) callback is called, which causes page=1
to load instead.
I think it would be better if the paginator was able to keep the current page without going back to page=1 on first load.