We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ecdd2a commit 0572d1aCopy full SHA for 0572d1a
packages/react-css-transition-replace/src/ReactCSSTransitionReplaceChild.js
@@ -106,8 +106,15 @@ class CSSTransitionGroupChild extends React.Component {
106
removeListeners()
107
}
108
109
- removeClass(node, className)
110
- removeClass(node, activeClassName)
+ // If we're leaving, removing the classes can result in a redraw before
+ // React has chance to actually remove the node, which results in a flash
111
+ // of both nodes being displayed at the same time with their default styles
112
+ // (ie, probably 100% opacity).
113
+ // Since the node is about to be removed, we don't actually need to clean up the classes on it.
114
+ if (animationType !== "leave") {
115
+ removeClass(node, className)
116
+ removeClass(node, activeClassName)
117
+ }
118
119
if (removeListeners) {
120
0 commit comments