- Notifications
You must be signed in to change notification settings - Fork 431
Closed
Labels
Description
I am getting below warning in paginator (2.0.0)
Warning: Failed prop type: Invalid prop `page` of type `object` supplied to `SizePerPageOption`, expected `number`. in SizePerPageOption (created by Context.Consumer) in SizePerPageDropDown (created by SizePerPageDropdownAdapter) in SizePerPageDropdownAdapter (created by Pagination) in div (created by Pagination) in div (created by Pagination) in Pagination (created by PaginationHandler) in PaginationHandler (created by PaginationDataProvider) in PaginationDataProvider (created by Context.Consumer) in SortProvider (created by Context.Consumer) in DataProvider (created by BootstrapTableContainer) in BootstrapTableContainer (created by <removed>)
Looks like the problem is at https://github.com/react-bootstrap-table/react-bootstrap-table2/blob/master/packages/react-bootstrap-table2-paginator/src/size-per-page-dropdown.js#L74
I think instead of {...option}
it should be page = {option.value}
as SizePerPageOption has only 4 props and while using default option renderer it is passing all 4 props so there is no point of passing full option to SizePerPageOption. It makes sense to pass full option to when the user is using custom option renderer.
Also found same issue #352 but I can't reopen that so creating a new one.