@@ -2,6 +2,7 @@ import * as PropTypes from 'prop-types'
22import React from 'react'
33import ReactDOM from 'react-dom'
44
5+ import config from './config'
56import { timeoutsShape } from './utils/PropTypes'
67import TransitionGroupContext from './TransitionGroupContext'
78
@@ -223,15 +224,13 @@ class Transition extends React.Component {
223224
224225 performEnter ( node , mounting ) {
225226 const { enter } = this . props
226- const appearing = this . context
227- ? this . context . isMounting
228- : mounting
227+ const appearing = this . context ? this . context . isMounting : mounting
229228
230229 const timeouts = this . getTimeouts ( )
231230 const enterTimeout = appearing ? timeouts . appear : timeouts . enter
232231 // no enter animation skip right to ENTERED
233232 // if we are mounting and running this it means appear _must_ be set
234- if ( ! mounting && ! enter ) {
233+ if ( ( ! mounting && ! enter ) || config . disabled ) {
235234 this . safeSetState ( { status : ENTERED } , ( ) => {
236235 this . props . onEntered ( node )
237236 } )
@@ -256,7 +255,7 @@ class Transition extends React.Component {
256255 const timeouts = this . getTimeouts ( )
257256
258257 // no exit animation skip right to EXITED
259- if ( ! exit ) {
258+ if ( ! exit || config . disabled ) {
260259 this . safeSetState ( { status : EXITED } , ( ) => {
261260 this . props . onExited ( node )
262261 } )
@@ -312,7 +311,8 @@ class Transition extends React.Component {
312311 onTransitionEnd ( node , timeout , handler ) {
313312 this . setNextCallback ( handler )
314313
315- const doesNotHaveTimeoutOrListener = timeout == null && ! this . props . addEndListener
314+ const doesNotHaveTimeoutOrListener =
315+ timeout == null && ! this . props . addEndListener
316316 if ( ! node || doesNotHaveTimeoutOrListener ) {
317317 setTimeout ( this . nextCallback , 0 )
318318 return
0 commit comments