props type mismatch for SizePerPageOption
See original GitHub issueI 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.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
typescript type mismatch issue - reactjs - Stack Overflow
I have difficulty understanding the first two lines of the function: type UpdateType = Dispatch<SetStateAction<typeof defaultValue>>; const ...
Read more >Blog · react-bootstrap-table2 - GitHub Pages
... Fixed column header hides but not columnBody or columnData(#741); Fixed props type mismatch for SizePerPageOption component(#742) ...
Read more >Wrong type mismatch errors are reported for React ... - YouTrack
Wrong type mismatch errors are reported for React "useContext()". Here is the code I'm referring to in my short video. import { useContext...
Read more >How to add type checking in React | by Yogesh Chavan
You will find prop-types used in a lot of popular libraries for type ... Then we can add type checking to check each...
Read more >How to forget about type errors in your React props with ...
React prop type is a library supported by React that lets you define ... props so no matter where the data source is,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@hirenvadalia ok, I will handle it, thanks and happy new year lol
RELEASE NOTE
Please upgrade
react-bootstrap-table-next@2.0.1,react-bootstrap-table2-paginator@2.0.1