@@ -2,6 +2,7 @@ import * as PropTypes from 'prop-types'
2
2
import React from 'react'
3
3
import ReactDOM from 'react-dom'
4
4
5
+ import config from './config'
5
6
import { timeoutsShape } from './utils/PropTypes'
6
7
import TransitionGroupContext from './TransitionGroupContext'
7
8
@@ -223,15 +224,13 @@ class Transition extends React.Component {
223
224
224
225
performEnter ( node , mounting ) {
225
226
const { enter } = this . props
226
- const appearing = this . context
227
- ? this . context . isMounting
228
- : mounting
227
+ const appearing = this . context ? this . context . isMounting : mounting
229
228
230
229
const timeouts = this . getTimeouts ( )
231
230
const enterTimeout = appearing ? timeouts . appear : timeouts . enter
232
231
// no enter animation skip right to ENTERED
233
232
// if we are mounting and running this it means appear _must_ be set
234
- if ( ! mounting && ! enter ) {
233
+ if ( ( ! mounting && ! enter ) || config . disabled ) {
235
234
this . safeSetState ( { status : ENTERED } , ( ) => {
236
235
this . props . onEntered ( node )
237
236
} )
@@ -256,7 +255,7 @@ class Transition extends React.Component {
256
255
const timeouts = this . getTimeouts ( )
257
256
258
257
// no exit animation skip right to EXITED
259
- if ( ! exit ) {
258
+ if ( ! exit || config . disabled ) {
260
259
this . safeSetState ( { status : EXITED } , ( ) => {
261
260
this . props . onExited ( node )
262
261
} )
@@ -312,7 +311,8 @@ class Transition extends React.Component {
312
311
onTransitionEnd ( node , timeout , handler ) {
313
312
this . setNextCallback ( handler )
314
313
315
- const doesNotHaveTimeoutOrListener = timeout == null && ! this . props . addEndListener
314
+ const doesNotHaveTimeoutOrListener =
315
+ timeout == null && ! this . props . addEndListener
316
316
if ( ! node || doesNotHaveTimeoutOrListener ) {
317
317
setTimeout ( this . nextCallback , 0 )
318
318
return
0 commit comments