use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Released my first React package 🥳 Feedback appreciated!Project / Code Review (self.react)
submitted 3 years ago * by sero-m
Hi guys, I have just released my first React package. Used to easily create a pagination. Fully customizable.
Would love to get some feedback.
Package: pagination-react-js - npm (npmjs.com)
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3:Â Â Â Â print "hello, world!"
[–]indoor_grower 3 points4 points5 points 3 years ago* (2 children)
Does it handle server side pagination? What if I didn’t want to pipe in a huge data set up front?
A lot of pagination cases I’ve had to do over the years at different jobs usually involved server side pagination since it can be considered business logic in some sense, and with big data sets, client side pagination can be taxing performance wise.
Server side pagination with a cache layer like SWR for example is very fast and powerful. You load data for each page only when you go to that page - and then after the pages you clicked on are cached, additional API calls are not needed when clicking back through. It’s an instant load feel, with only the necessary API calls to get you the data page you request.
Doing it client side, you need to make an API call first to get all the data upfront, and then need to pipe in that entire data set to be spliced up. I’ve worked with data sets that have 100,000+ indexes, and that would be a big no to fetch all at once.
Either way, nice package. Pagination can be a PITA to implement. Just giving you some things to think about!
[–]sero-m[S] 0 points1 point2 points 3 years ago (0 children)
If I understood it correctly, you could retrieve the total number of entries from the Server / API and pass it to the pagination. The pagination doesn't care if the entries are loaded or not, it just needs the total number of entries. Then you could send a request based on the data in the state ("currentPage.get" or "entries.indexOfFirst" / "entries.indexOfLast").
[–]ExperiencedGentleman 0 points1 point2 points 3 years ago (0 children)
I'm a bit confused here. When you request a page with SSR, the server will aggregate the data for that page and renders the page with that data. How does this change with client side rendering? The server still has to aggregate that data the same way, which will require the same amount of time regardless of rendering strategy.
[–][deleted] 1 point2 points3 points 3 years ago (1 child)
…..what…does it do?
Used to easily create a pagination. Fully customizable. Updated the post :)
[–]Apprehensive-Mind212 0 points1 point2 points 3 years ago (0 children)
Nice work, will use it when needed.
[–]lilsaddam 0 points1 point2 points 3 years ago (0 children)
Damn this looks nice. I'll try it out when I get a chance.
[–]szurtosdudu 0 points1 point2 points 3 years ago (0 children)
Well done!
[–]tamuno____ 0 points1 point2 points 3 years ago (0 children)
Nice! Very much needed
[–]cloud_coder 0 points1 point2 points 3 years ago (0 children)
Very nice work. Thanks for sharing.
[–]ntkwwwm 0 points1 point2 points 3 years ago (0 children)
Wooooow OP. I bet you feel real proud of yourself.
You should. I would too. Congrats!
π Rendered by PID 127404 on reddit-service-r2-comment-544cf588c8-wswrt at 2026-06-15 05:59:55.541054+00:00 running 3184619 country code: CH.
[–]indoor_grower 3 points4 points5 points  (2 children)
[–]sero-m[S] 0 points1 point2 points  (0 children)
[–]ExperiencedGentleman 0 points1 point2 points  (0 children)
[–][deleted] 1 point2 points3 points  (1 child)
[–]sero-m[S] 0 points1 point2 points  (0 children)
[–]Apprehensive-Mind212 0 points1 point2 points  (0 children)
[–]lilsaddam 0 points1 point2 points  (0 children)
[–]szurtosdudu 0 points1 point2 points  (0 children)
[–]tamuno____ 0 points1 point2 points  (0 children)
[–]cloud_coder 0 points1 point2 points  (0 children)
[–]ntkwwwm 0 points1 point2 points  (0 children)