Remove prepareNewChildrenBeforeUnmountInStack flag (#9872)
Dan Abramov committed
Jun 6, 2017 at 23:22 UTC
b840229286ac2a82fa49553ce793cf7b953d1845
3 files changed
+6
-34
src/renderers/shared/stack/reconciler/ReactChildReconciler.js
+1
-16
@@ -12,7 +12,6 @@
12
'use strict';
13
14
var KeyEscapeUtils = require('KeyEscapeUtils');
15
-var ReactFeatureFlags = require('ReactFeatureFlags');
15
var ReactReconciler = require('ReactReconciler');
16
17
var instantiateReactComponent = require('instantiateReactComponent');
@@ -148,17 +147,6 @@ var ReactChildReconciler = {
147
);
148
nextChildren[name] = prevChild;
149
} else {
151
- if (
152
- !ReactFeatureFlags.prepareNewChildrenBeforeUnmountInStack &&
153
- prevChild
154
- ) {
155
- removedNodes[name] = ReactReconciler.getHostNode(prevChild);
156
- ReactReconciler.unmountComponent(
157
- prevChild,
158
- false /* safely */,
159
- false /* skipLifecycle */,
160
- );
161
- }
150
// The child must be instantiated before it's mounted.
151
var nextChildInstance = instantiateReactComponent(nextElement, true);
152
nextChildren[name] = nextChildInstance;
@@ -173,10 +161,7 @@ var ReactChildReconciler = {
161
selfDebugID,
162
);
163
mountImages.push(nextChildMountImage);
176
- if (
177
- ReactFeatureFlags.prepareNewChildrenBeforeUnmountInStack &&
178
- prevChild
179
- ) {
164
+ if (prevChild) {
165
removedNodes[name] = ReactReconciler.getHostNode(prevChild);
166
ReactReconciler.unmountComponent(
167
prevChild,
src/renderers/shared/stack/reconciler/ReactCompositeComponent.js
+5
-17
@@ -15,7 +15,6 @@ var React = require('react');
15
var ReactComponentEnvironment = require('ReactComponentEnvironment');
16
var ReactCompositeComponentTypes = require('ReactCompositeComponentTypes');
17
var ReactErrorUtils = require('ReactErrorUtils');
18
-var ReactFeatureFlags = require('ReactFeatureFlags');
18
var ReactInstanceMap = require('ReactInstanceMap');
19
var ReactInstrumentation = require('ReactInstrumentation');
20
var ReactNodeTypes = require('ReactNodeTypes');
@@ -1157,15 +1156,6 @@ var ReactCompositeComponent = {
1156
);
1157
} else {
1158
var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance);
1160
-
1161
- if (!ReactFeatureFlags.prepareNewChildrenBeforeUnmountInStack) {
1162
- ReactReconciler.unmountComponent(
1163
- prevComponentInstance,
1164
- safely,
1165
- false /* skipLifecycle */,
1166
- );
1167
- }
1168
-
1159
var nodeType = ReactNodeTypes.getType(nextRenderedElement);
1160
this._renderedNodeType = nodeType;
1161
var child = this._instantiateReactComponent(
@@ -1183,13 +1173,11 @@ var ReactCompositeComponent = {
1173
debugID,
1174
);
1175
1186
- if (ReactFeatureFlags.prepareNewChildrenBeforeUnmountInStack) {
1187
- ReactReconciler.unmountComponent(
1188
- prevComponentInstance,
1189
- safely,
1190
- false /* skipLifecycle */,
1191
- );
1192
- }
1176
+ ReactReconciler.unmountComponent(
1177
+ prevComponentInstance,
1178
+ safely,
1179
+ false /* skipLifecycle */,
1180
+ );
1181
1182
if (__DEV__) {
1183
if (debugID !== 0) {
src/renderers/shared/utils/ReactFeatureFlags.js
-1
@@ -13,7 +13,6 @@
13
'use strict';
14
15
var ReactFeatureFlags = {
16
- prepareNewChildrenBeforeUnmountInStack: true,
16
disableNewFiberFeatures: false,
17
enableAsyncSubtreeAPI: false,
18
};