-
Notifications
You must be signed in to change notification settings - Fork 14
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
Prop types fix #723
base: airship-3.0
Are you sure you want to change the base?
Prop types fix #723
Conversation
@@ -107,7 +107,7 @@ CategoryWidgetUI.propTypes = { | |||
data: PropTypes.arrayOf( | |||
PropTypes.shape({ | |||
category: PropTypes.string.isRequired, | |||
value: PropTypes.number.isRequired | |||
value: PropTypes.number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we can use oneOfType
and allow number/string/null
After checking the docs again, I see that this is the recommended way for null
(plus undefined
and so)
I agree with the change.
]).isRequired, | ||
unit: PropTypes.string.isRequired | ||
]), | ||
unit: PropTypes.string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, until we want to allow empty units using this format, in that case, ok
Maybe here I'll rather improve the way to paint the unit, to skip it in case of not existing, because right now it could leave an empty space before the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.