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 8cc3b26 commit 2609bdbCopy full SHA for 2609bdb
src/ReactCSSTransitionReplace.jsx
@@ -82,8 +82,11 @@ export default class ReactCSSTransitionReplace extends React.Component {
82
const nextChild = nextProps.children ? React.Children.only(nextProps.children) : undefined
83
const {currentChild} = this.state
84
85
- if ((!currentChild && !nextChild) || (currentChild && nextChild && currentChild.key === nextChild.key)) {
86
- return
+ if (currentChild && nextChild && nextChild.key === currentChild.key && !this.state.nextChild) {
+ // This is the same child, but receiving new props means the child itself has re-rendered
87
+ return this.setState({
88
+ currentChild: nextChild,
89
+ })
90
}
91
92
const {currentKey, prevChildren} = this.state
0 commit comments