@@ -5,7 +5,7 @@ import ReactDOM from 'react-dom';
5
5
import config from './config' ;
6
6
import { timeoutsShape } from './utils/PropTypes' ;
7
7
import TransitionGroupContext from './TransitionGroupContext' ;
8
- import { nextTick } from './utils/nextTick ' ;
8
+ import { forceReflow } from './utils/reflow ' ;
9
9
10
10
export const UNMOUNTED = 'unmounted' ;
11
11
export const EXITED = 'exited' ;
@@ -213,15 +213,16 @@ class Transition extends React.Component {
213
213
this . cancelNextCallback ( ) ;
214
214
215
215
if ( nextStatus === ENTERING ) {
216
- // https://github.com/reactjs/react-transition-group/pull/749
217
- // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.
218
- // To make the animation happen, we have to separate each rendering and avoid being processed as batched.
219
216
if ( this . props . unmountOnExit || this . props . mountOnEnter ) {
220
- // `exited` -> `entering`
221
- nextTick ( ( ) => this . performEnter ( mounting ) ) ;
222
- } else {
223
- this . performEnter ( mounting ) ;
217
+ const node = this . props . nodeRef
218
+ ? this . props . nodeRef . current
219
+ : ReactDOM . findDOMNode ( this ) ;
220
+ // https://github.com/reactjs/react-transition-group/pull/749
221
+ // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.
222
+ // To make the animation happen, we have to separate each rendering and avoid being processed as batched.
223
+ if ( node ) forceReflow ( node ) ;
224
224
}
225
+ this . performEnter ( mounting ) ;
225
226
} else {
226
227
this . performExit ( ) ;
227
228
}
0 commit comments