-
Notifications
You must be signed in to change notification settings - Fork 832
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
Added type number to proptypes #1627
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for evergreen-storybook ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Thanks. Fixes #1625 |
It's not linking it for auto-closure in the sidebar. I think you'll have to edit the top description and add the Thanks for the work. Appreciate it. |
Shouldn't we also support an array of numbers? I'm not sure why it allows an array of strings though, is that for multi-select? But then again it does say |
In case of single or multi select, I think this code block will cover both the scenarios |
That won't work probably for single select, as it's not an array. This would: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.arrayOf(PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
]))
]) But that may not be proper, since it allows mixed arrays (both strings and numbers in the same array). This below won't allow mixed arrays. The arrays have to be pure: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.arrayOf(PropTypes.string),
PropTypes.arrayOf(PropTypes.number)
]) I would go with this instead. |
Hey folks - I think we'll need to update the TS definitions with whatever we use for PropTypes, as well. If you're using TS, you currently can't pass a number to |
Overview
Fixes #1625
Instead of making changes in the SelectMenu.js file, we can directly change the SelectedPropType.js file and add PropTypes.number to PropTypes.oneOfType() function
Screenshots (if applicable)
Documentation