Skip to content

Conversation

@le0nik
Copy link
Contributor

@le0nik le0nik commented Jun 30, 2017

When multiple children are provided right now they are mapped through React.Children.map which changes keys from foo to .$foo. With complex re-renders I've encountered situations where the key changes with each re-render of the parent component so it starts with foo -> .$foo -> .$.$foo etc, which results in that child component being re-mounted with each re-render and loose it's internal state.

This PR changes React.Children.map to React.Children.forEach which doesn't mess with the keys, while leaving the other map's functionality intact.

@gajus gajus merged commit 407cdb4 into gajus:master Jul 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants