diff --git a/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js b/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js index f534cfd5c7..f1cc7086f4 100644 --- a/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js +++ b/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js @@ -850,6 +850,7 @@ var ReactCompositeComponent = { // _pendingStateQueue which will ensure that any state updates gets // immediately reconciled instead of waiting for the next batch. if (willReceive && inst.componentWillReceiveProps) { + const beforeState = inst.state; if (__DEV__) { measureLifeCyclePerf( () => inst.componentWillReceiveProps(nextProps, nextContext), @@ -859,6 +860,11 @@ var ReactCompositeComponent = { } else { inst.componentWillReceiveProps(nextProps, nextContext); } + const afterState = inst.state; + if (beforeState !== afterState) { + inst.state = beforeState; + inst.updater.enqueueReplaceState(inst, afterState); + } } // If updating happens to enqueue any new updates, we shouldn't execute new