Skip to content

[Addons] Fix TransitionGroup null children bug #1958

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
wants to merge 1 commit into from

Conversation

chenglou
Copy link
Contributor

Fixes #1949

When we render two children to two nulls, ReactTransitionChildMapping.getChildMapping now returns {} rather than {'.0': null, '.1': null}. Otherwise mergeChildMapping doesn't doesn't understand that the children have disappeared.

* Given `this.props.children`, return an object mapping key to child. Just
* simple syntactic sugar around ReactChildren.map().
* Given `this.props.children`, return an object mapping key to child. `null`
* and `undefined` and stripped.
Copy link
Collaborator

Choose a reason for hiding this comment

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

are stripped?

@zpao
Copy link
Member

zpao commented Jul 31, 2014

@petehunt

@sophiebits
Copy link
Collaborator

(I approve making getChildMapping skip nulls, though I'm a little iffy on the test case…)

Fixes facebook#1949

When we render two children to two nulls, `ReactTransitionChildMapping.getChildMapping` now returns `{}` rather than `{'.0': null, '.1': null}`. Otherwise mergeChildMapping doesn't doesn't understand that the children have disappeared.
@chenglou
Copy link
Contributor Author

The test case being iffy is because of another bug (#1959). That one is easy to fix but requires changing every test to async. I'll pull this in for now.

@sophiebits
Copy link
Collaborator

@chenglou Do we still want this?

@jimfb
Copy link
Contributor

jimfb commented Nov 10, 2015

This is over a year old, has a merge conflict, and I doubt @chenglou is going to be fixing it at this point. So... I'm going to close it out.

@jimfb jimfb closed this Nov 10, 2015
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.

TransitionGroup buggy with null children
7 participants