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 {
216216 if ( nextStatus !== null ) {
217217 // nextStatus will always be ENTERING or EXITING.
218218 this . cancelNextCallback ( )
219- const node = ReactDOM . findDOMNode ( this )
219+ const node = this . needsNode ( ) ? ReactDOM . findDOMNode ( this ) : null ;
220220
221221 if ( nextStatus === ENTERING ) {
222222 this . performEnter ( node , mounting )
@@ -334,6 +334,19 @@ class Transition extends React.Component {
334334 }
335335 }
336336
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+
337350 render ( ) {
338351 const status = this . state . status
339352 if ( status === UNMOUNTED ) {
You can’t perform that action at this time.
0 commit comments