Skip to content

Commit 143ee62

Browse files
committed
Leave transition dominates for no current child or one that renders null.
1 parent 64b4693 commit 143ee62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ReactCSSTransitionReplace.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ export default class ReactCSSTransitionReplace extends React.Component {
170170
performLeave = (key) => {
171171
this.transitioningKeys[key] = true
172172
this.childRefs[key].componentWillLeave(this.handleDoneLeaving.bind(this, key))
173-
if (!this.state.currentChild) {
174-
// The enter transition dominates, but if there is no
175-
// entering component the height is set to zero.
173+
if (!this.state.currentChild || !findDOMNode(this.childRefs[this.state.currentKey])) {
174+
// The enter transition dominates, but if there is no entering
175+
// component or it renders null the height is set to zero.
176176
this.enqueueHeightTransition()
177177
}
178178
}
@@ -184,7 +184,7 @@ export default class ReactCSSTransitionReplace extends React.Component {
184184
delete nextState.prevChildren[key]
185185
delete this.childRefs[key]
186186

187-
if (!this.state.currentChild) {
187+
if (!this.state.currentChild || !findDOMNode(this.childRefs[this.state.currentKey])) {
188188
nextState.height = null
189189
}
190190

0 commit comments

Comments
 (0)