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

fix(text-detail): proptypes warning when providing an empty string as… #1214

Conversation

ahmehri
Copy link
Member

@ahmehri ahmehri commented Dec 10, 2019

… children to TextDetail component

Summary

A PropTypes warning will be thrown when providing an empty string as the children of Text.Detail component.

Description

The bug is caused by the empty string being coerced to false, this PR fixes it by counting the children instead.

Fixes #1212

@vercel
Copy link

vercel bot commented Dec 10, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/commercetools/ui-kit/86kiuaabg
🌍 Preview: https://ui-kit-git-am-fix-textdetail-proptypes-warning-w-d93f6e.commercetools.now.sh

@ahmehri ahmehri requested review from jonnybel and tdeekens December 10, 2019 17:35
@ahmehri ahmehri added the 🐛 Type: Bug Something isn't working label Dec 10, 2019
Copy link
Contributor

@jonnybel jonnybel left a comment

Choose a reason for hiding this comment

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

Thanks!

Could you also make the same changes to the rest of the Text components (Body, Headline, etc) ?

Copy link
Contributor

@tdeekens tdeekens left a comment

Choose a reason for hiding this comment

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

Nice use of the top-level API!

@ahmehri
Copy link
Member Author

ahmehri commented Dec 11, 2019

@jonnybel Yes, I will do the changes for other components as well 👍 .

Copy link
Contributor

@jonnybel jonnybel left a comment

Choose a reason for hiding this comment

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

Neat 👌

@kodiakhq kodiakhq bot merged commit 14e6d34 into master Dec 11, 2019
@kodiakhq kodiakhq bot deleted the am-fix-TextDetail-proptypes-warning-when-empty-string-as-children branch December 11, 2019 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PropTypes warning when providing an empty string to TextDetail
3 participants