react-paginate
react-paginate copied to clipboard
Warning - The pageCount prop value provided is not an integer
I am using NextJs to create an application. react-paginate throws warning.
(react-paginate): The pageCount prop value provided is not an integer (true). Did you forget a Math.ceil()?
I have tried with const pageCount = (Math.ceil(table?.getPageCount() - 1)); const pageCount = parseInt(Math.ceil(table?.getPageCount() - 1));
console output is console.log(pageCount) number
Still its showing warning.
@Indranil-R I want to work on this issue, can you please assign it to me.
@Indranil-R please assign this one to me
use like this
const pageCosunt = parseInt(Math.ceil(table?.getPageCount() - 1) || 1);
just use a logical OR and add 1 by default.
use like this
const pageCosunt = parseInt(Math.ceil(table?.getPageCount() - 1) || 1);
just use a logical OR and add 1 by default.
Nope, this doesn't help.
@Indranil-R I want to work on this issue, can you please assign it to me. @alisher-aituarov
Can I you tell me how to assign it to you? I am not sure how to do it.
same issue
we have same issue. Is it relevant that Next.js is version 13.5?
Was having the same issue. Going back to Next.js version 13.5.3 seems to fix this issue in production builds.
Same issue using Next.js v13.5.4. This error only occurs when building the application. In development, it works just fine.
Even when assigning a hard-coded value to pageCount, it still reads (undefined).
Currently, I have downgraded Next.js from v13.5.4 to v13.5.1 to make it work.
Seems like we are all having the issue #501
13.5.3 is working fine on a build, so it is something that happened specifically between 13.5.3 and 13.5.4.
Tracking it down further, it happened between 13.5.4-canary.8 (works) and 13.5.4-canary.9 (broken).
Any fix for this? Has anyone tested in Next.js 14?