diff --git a/src/renderers/shared/reconciler/ReactUpdateQueue.js b/src/renderers/shared/reconciler/ReactUpdateQueue.js index dbb81c039f..e039558c59 100644 --- a/src/renderers/shared/reconciler/ReactUpdateQueue.js +++ b/src/renderers/shared/reconciler/ReactUpdateQueue.js @@ -117,8 +117,7 @@ var ReactUpdateQueue = { // behavior we have in other enqueue* methods. // We also need to ignore callbacks in componentWillMount. See // enqueueUpdates. - if (!internalInstance || - internalInstance === ReactLifeCycle.currentlyMountingInstance) { + if (!internalInstance) { return null; } diff --git a/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentState-test.js b/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentState-test.js index 0c4d1ab168..1547f47f33 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentState-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentState-test.js @@ -147,7 +147,7 @@ describe('ReactCompositeComponent-state', function() { React.unmountComponentAtNode(container); - expect(stateListener.mock.calls).toEqual([ + expect(stateListener.mock.calls.join('\n')).toEqual([ // there is no state when getInitialState() is called ['getInitialState', null], ['componentWillMount-start', 'red'], @@ -173,6 +173,8 @@ describe('ReactCompositeComponent-state', function() { ['render', 'yellow'], ['componentDidUpdate-currentState', 'yellow'], ['componentDidUpdate-prevState', 'orange'], + ['setState-sunrise', 'yellow'], + ['setState-orange', 'yellow'], ['setState-yellow', 'yellow'], ['initial-callback', 'yellow'], ['componentWillReceiveProps-start', 'yellow'], @@ -210,7 +212,7 @@ describe('ReactCompositeComponent-state', function() { // unmountComponent() // state is available within `componentWillUnmount()` ['componentWillUnmount', 'blue'], - ]); + ].join('\n')); }); it('should batch unmounts', function() {