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 {
222222 if ( nextStatus !== null ) {
223223 // nextStatus will always be ENTERING or EXITING.
224224 this . cancelNextCallback ( )
225- const node = ReactDOM . findDOMNode ( this )
225+ const node = this . needsNode ( ) ? ReactDOM . findDOMNode ( this ) : null ;
226226
227227 if ( nextStatus === ENTERING ) {
228228 this . performEnter ( node , mounting )
@@ -340,6 +340,19 @@ class Transition extends React.Component {
340340 }
341341 }
342342
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+
343356 render ( ) {
344357 const status = this . state . status
345358 if ( status === UNMOUNTED ) {
You can’t perform that action at this time.
0 commit comments