-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Description
- The issue is present in the latest
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
When passing float 'count' props to PaginationComponent bugs occur.

You can see our discussion with @oliviertassinari about this behavior in this link.
The 'nextbutton' is not disabled on the last page when count is provided with a float number.
<Pagination count={1.3} />result: link to sandbox
Expected Behavior 🤔
PaginationComponent should return a warning when count is provided with a float number.
Steps to Reproduce 🕹
PaginationComponent proptypes uses number proptype for validating. Instead, I have changed to my custom proptype which warns the developer when he/she passes a float number as a proptype. Moreover, the component gives an error when it is not provided with a number at all.
Steps:
- Change
PaginationComponentcountproptype with custom proptype
My build result: codesandbox link
Screenshot:

Context 🔦
I used the PaginationComponent whilst dividing the totalAmount into pages, of length 30. Sometimes this division resulted in float numbers which I passed to PaginationComponent thus I had a bug with the clickable next page button on the last page.
Your Environment 🌎
Using FireFox