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

Improve warnings checks #75

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

FrancescoCioria
Copy link
Contributor

No description provided.

@nemobot nemobot added the WIP label Jan 24, 2019
@nemobot nemobot added in review and removed WIP labels Jan 24, 2019
@FrancescoCioria
Copy link
Contributor Author

@giogonzo React.Children.toArray does exactly what we tried to replicate (with maany bugs)... and it's also typed!

No one reported a bug for the current implementation, but this greatly simplifies the warning logic and it enables TS to be useful.

Copy link
Member

@giogonzo giogonzo left a comment

Choose a reason for hiding this comment

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

Looks 💯

> = React.Children.toArray(this.props.children);

if (!column && hAlignContent === "center") {
const atLeastOneChildHasHMarginAuto = some(children, child => {
Copy link
Member

Choose a reason for hiding this comment

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

not related, and not sure about our current browser support target here, but this could easily be rewritten using Array.prototype.some and maybe drop some kB from the package?

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

Successfully merging this pull request may close these issues.

3 participants