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 @@ -209,7 +209,7 @@ class Transition extends React.Component {
209
209
if ( nextStatus !== null ) {
210
210
// nextStatus will always be ENTERING or EXITING.
211
211
this . cancelNextCallback ( )
212
- const node = ReactDOM . findDOMNode ( this )
212
+ const node = this . needsNode ( ) ? ReactDOM . findDOMNode ( this ) : null ;
213
213
214
214
if ( nextStatus === ENTERING ) {
215
215
this . performEnter ( node , mounting )
@@ -327,6 +327,19 @@ class Transition extends React.Component {
327
327
}
328
328
}
329
329
330
+ needsNode ( ) {
331
+ return [
332
+ 'addEndListener' ,
333
+ 'onEnter' ,
334
+ 'onEntering' ,
335
+ 'onEntered' ,
336
+ 'onExit'
337
+ ] . some ( callbackName => {
338
+ const callback = this . props [ callbackName ] ;
339
+ return callback && callback . length > 0
340
+ } )
341
+ }
342
+
330
343
render ( ) {
331
344
const status = this . state . status
332
345
if ( status === UNMOUNTED ) {
You can’t perform that action at this time.
0 commit comments