react-paginate icon indicating copy to clipboard operation
react-paginate copied to clipboard

Hangs forever when pageCount is `Infinity`

Open gsouf opened this issue 1 year ago • 3 comments

The following code will cause the browser to hang forever:

  <ReactPaginate
    pageCount={Infinity}
   ....
  />

Most likely it falls into an endless loop.

While a user shouldn't pass infinity, it can be done by mistake and the fact that it breaks and freezes the whole UI without a notice makes it hard to figure out. For example it will happen if the user divides something 0, that javascript allows.

gsouf avatar May 23 '24 00:05 gsouf

I noticed with really large page counts, this component gets very slow. Were you able to find any workaround?

NgoKnows avatar Jun 24 '24 20:06 NgoKnows

@NgoKnows the issue I mentioned about infinity is not about being slow, it's about falling into something like an endless loop and totally freezing the browser.

I haven't had to deal with large page count, so I can't really tell about it sorry

gsouf avatar Jun 25 '24 01:06 gsouf

As the maintainer does not update this pkg for a long time, I think you should manage it by yourself.

semanticist21 avatar Oct 29 '24 10:10 semanticist21