question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

props type mismatch for SizePerPageOption

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
AllenFangcommented, Jan 2, 2019

@hirenvadalia ok, I will handle it, thanks and happy new year lol

0reactions
AllenFangcommented, Jan 6, 2019

RELEASE NOTE

Please upgrade react-bootstrap-table-next@2.0.1, react-bootstrap-table2-paginator@2.0.1

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found