Skip to content

<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

Merged
merged 1 commit into from
May 14, 2015
Merged

<option> added children flatten, & warn if invalid #3847

merged 1 commit into from
May 14, 2015

Conversation

bloodyowl
Copy link
Contributor

fixes #2620

@@ -17,6 +17,7 @@ var ReactDOMSelect = require('ReactDOMSelect');
var ReactElement = require('ReactElement');
var ReactInstanceMap = require('ReactInstanceMap');
var ReactPropTypes = require('ReactPropTypes');
var ReactChildren = require('ReactChildren');
Copy link
Collaborator

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?

@sophiebits
Copy link
Collaborator

Just a few inlines – otherwise looks great. If you could make those updates and squash your commits I'll merge.

@bloodyowl
Copy link
Contributor Author

@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) {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops, fixed;

@MoOx
Copy link

MoOx commented May 13, 2015

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') {
Copy link
Collaborator

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.

@bloodyowl
Copy link
Contributor Author

done @spicyj

sophiebits added a commit that referenced this pull request May 14, 2015
<option> added children flatten, & warn if invalid
@sophiebits sophiebits merged commit 7112a35 into facebook:master May 14, 2015
@sophiebits
Copy link
Collaborator

Thanks!

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.

"Unable to find element" error on <option> elements
7 participants