File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ class Transition extends React.Component {
216
216
if ( nextStatus !== null ) {
217
217
// nextStatus will always be ENTERING or EXITING.
218
218
this . cancelNextCallback ( )
219
- const node = ReactDOM . findDOMNode ( this )
219
+ const node = this . needsNode ( ) ? ReactDOM . findDOMNode ( this ) : null ;
220
220
221
221
if ( nextStatus === ENTERING ) {
222
222
this . performEnter ( node , mounting )
@@ -334,6 +334,19 @@ class Transition extends React.Component {
334
334
}
335
335
}
336
336
337
+ needsNode ( ) {
338
+ return [
339
+ 'addEndListener' ,
340
+ 'onEnter' ,
341
+ 'onEntering' ,
342
+ 'onEntered' ,
343
+ 'onExit'
344
+ ] . some ( callbackName => {
345
+ const callback = this . props [ callbackName ] ;
346
+ return callback && callback . length > 0
347
+ } )
348
+ }
349
+
337
350
render ( ) {
338
351
const status = this . state . status
339
352
if ( status === UNMOUNTED ) {
You can’t perform that action at this time.
0 commit comments