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

Prop types fix #723

Open
wants to merge 1 commit into
base: airship-3.0
Choose a base branch
from
Open

Prop types fix #723

wants to merge 1 commit into from

Conversation

alasarr
Copy link
Contributor

@alasarr alasarr commented Nov 4, 2020

No description provided.

@alasarr alasarr requested a review from neokore November 4, 2020 06:38
@@ -107,7 +107,7 @@ CategoryWidgetUI.propTypes = {
data: PropTypes.arrayOf(
PropTypes.shape({
category: PropTypes.string.isRequired,
value: PropTypes.number.isRequired
value: PropTypes.number
Copy link
Contributor

@neokore neokore Nov 4, 2020

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
Copy link
Contributor

@neokore neokore Nov 4, 2020

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.

Copy link
Contributor

@neokore neokore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

2 participants