Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown with number as selectedItem throws warning #9413

Closed
alissa9090 opened this issue Aug 4, 2021 · 0 comments · Fixed by #9421
Closed

Dropdown with number as selectedItem throws warning #9413

alissa9090 opened this issue Aug 4, 2021 · 0 comments · Fixed by #9421

Comments

@alissa9090
Copy link
Contributor

alissa9090 commented Aug 4, 2021

The current version of Dropdown accepts selectedItem prop with the following type:
selectedItem: PropTypes.oneOfType([PropTypes.object, PropTypes.string])

In our project (and I think this is a common case for many projects) selectedItem is either id of some entity or an enum value. And those value may have number type quite often. It causes warning in a console:
Warning: Failed prop type: Invalid prop 'selectedItem' supplied to 'Dropdown'.

I would suggest to remove type restriction for selectedItem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants