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 @@ -222,7 +222,7 @@ class Transition extends React.Component {
222
222
if ( nextStatus !== null ) {
223
223
// nextStatus will always be ENTERING or EXITING.
224
224
this . cancelNextCallback ( )
225
- const node = ReactDOM . findDOMNode ( this )
225
+ const node = this . needsNode ( ) ? ReactDOM . findDOMNode ( this ) : null ;
226
226
227
227
if ( nextStatus === ENTERING ) {
228
228
this . performEnter ( node , mounting )
@@ -340,6 +340,19 @@ class Transition extends React.Component {
340
340
}
341
341
}
342
342
343
+ needsNode ( ) {
344
+ return [
345
+ 'addEndListener' ,
346
+ 'onEnter' ,
347
+ 'onEntering' ,
348
+ 'onEntered' ,
349
+ 'onExit'
350
+ ] . some ( callbackName => {
351
+ const callback = this . props [ callbackName ] ;
352
+ return callback && callback . length > 0
353
+ } )
354
+ }
355
+
343
356
render ( ) {
344
357
const status = this . state . status
345
358
if ( status === UNMOUNTED ) {
You can’t perform that action at this time.
0 commit comments