Skip to content

Use React.Children to iterate/mutate children #319

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

Closed
bbodi opened this issue Mar 8, 2016 · 2 comments
Closed

Use React.Children to iterate/mutate children #319

bbodi opened this issue Mar 8, 2016 · 2 comments
Labels

Comments

@bbodi
Copy link

bbodi commented Mar 8, 2016

According to React,

when there is only a single child, this.props.children will be the single child component itself without the array wrapper. This saves an array allocation.

In my application, an error occurred at this line, because of one of my one-column table.

Uncaught TypeError: children.map is not a function

My suggestion is to use React.Children.map.

Sorry for not implementing and testing it myself, but currently I haven't got the infrastructure to do that.

@bbodi bbodi changed the title Use React.Children to iterate/mtuate children Use React.Children to iterate/mutate children Mar 8, 2016
@AllenFang
Copy link
Owner

@bbodi, I'll check this out! Thanks 👍

@AllenFang
Copy link
Owner

@bbodi, I've fixed it and release on v1.6.1

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

No branches or pull requests

2 participants