Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Fix Children.toArray when passed undefined #341

Merged
merged 2 commits into from
Apr 5, 2017

Conversation

AlexanderOtavka
Copy link
Contributor

There are cases when this.props.chidren is undefined and toArray was returning an array containing undefined instead of an empty array.

There are cases when `this.props.chidren` is undefined and toArray was returning an array containing undefined instead of an empty array.
@AlexanderOtavka
Copy link
Contributor Author

This PR shouldn't be necessary if we fix the issue in #319.

@developit
Copy link
Member

Good catch. I think we might need to do an explicit check there so this doesn't also drop 0 and false children values.

@AlexanderOtavka
Copy link
Contributor Author

Done! Let me know if there is anything else.

@developit
Copy link
Member

I might inline this into the ternary, but TBH uglify will do that for us anyway.

@developit developit merged commit 046bd24 into preactjs:master Apr 5, 2017
@AlexanderOtavka AlexanderOtavka deleted the patch-1 branch April 5, 2017 22:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants