-
Notifications
You must be signed in to change notification settings - Fork 48.6k
<option> added children flatten, & warn if invalid #3847
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
Conversation
@@ -17,6 +17,7 @@ var ReactDOMSelect = require('ReactDOMSelect'); | |||
var ReactElement = require('ReactElement'); | |||
var ReactInstanceMap = require('ReactInstanceMap'); | |||
var ReactPropTypes = require('ReactPropTypes'); | |||
var ReactChildren = require('ReactChildren'); |
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.
Can you put this in alpha order?
Just a few inlines – otherwise looks great. If you could make those updates and squash your commits I'll merge. |
@spicyj done 😉 |
// Flatten children and warn if they aren't strings or numbers; | ||
// invalid types are ignored. | ||
ReactChildren.forEach(this.props.children, function(child) { | ||
if (child == null || child === false) { |
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.
true
didn't get any love?
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.
whoops, fixed;
really nice work ! |
// Flatten children and warn if they aren't strings or numbers; | ||
// invalid types are ignored. | ||
ReactChildren.forEach(this.props.children, function(child) { | ||
if (child == null || typeof child === 'boolean') { |
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.
You shouldn't need the boolean check here; forEach should map bools to null for you. Can you try removing this? I think your test will still pass.
done @spicyj |
<option> added children flatten, & warn if invalid
Thanks! |
fixes #2620