DEV Community

Discussion on: Pagination in Javascript and React, with a custom usePagination() hook

Collapse
 
mbrookes profile image
Matt

Here's a fully functional usePagination hook, with a demo of rendering buttons and an ellipsis: mui.com/components/pagination/#use...

Collapse
 
damiisdandy profile image
damilola jerugba

Thatโ€™s great, but youโ€™ll need install the โ€˜@muiโ€™ library to use it

Thread Thread
 
mbrookes profile image
Matt

Well, sure, but that's a single command (yarn add or npm install). And since all you import is the hook, that's all that will be included in your bundle.

Thread Thread
 
damiisdandy profile image
damilola jerugba

I'll try that, but I'll still challenge myself and create a npm package, it will be my first open source project

Thread Thread
 
mbrookes profile image
Matt

Of course! And perhaps youโ€™ll find a more elegant implementation. Itโ€™s a tricky problem to solve! Good luck! ๐Ÿ‘