Ensure Fundamental flags are added to more locations (#16311)
Dominic Gannaway committed
Aug 7, 2019 at 14:48 UTC
028c07f89ca7e81b9af9afda44b58fd812f7dbf7
3 files changed
+5
-4
packages/react-reconciler/src/ReactFiberCommitWork.js
+2
-2
@@ -1043,7 +1043,7 @@ function commitPlacement(finishedWork: Fiber): void {
1043
let node: Fiber = finishedWork;
1044
while (true) {
1045
const isHost = node.tag === HostComponent || node.tag === HostText;
1046
- if (isHost || node.tag === FundamentalComponent) {
1046
+ if (isHost || (enableFundamentalAPI && node.tag === FundamentalComponent)) {
1047
const stateNode = isHost ? node.stateNode : node.stateNode.instance;
1048
if (before) {
1049
if (isContainer) {
@@ -1144,7 +1144,7 @@ function unmountHostComponents(current, renderPriorityLevel): void {
1144
);
1145
}
1146
// Don't visit children because we already visited them.
1147
- } else if (node.tag === FundamentalComponent) {
1147
+ } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
1148
const fundamentalNode = node.stateNode.instance;
1149
commitNestedUnmounts(node, renderPriorityLevel);
1150
// After all the children have unmounted, it is now safe to remove the
packages/react-reconciler/src/ReactFiberCompleteWork.js
+1
-1
@@ -168,7 +168,7 @@ if (supportsMutation) {
168
while (node !== null) {
169
if (node.tag === HostComponent || node.tag === HostText) {
170
appendInitialChild(parent, node.stateNode);
171
- } else if (node.tag === FundamentalComponent) {
171
+ } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
172
appendInitialChild(parent, node.stateNode.instance);
173
} else if (node.tag === HostPortal) {
174
// If we have a portal child, then we don't want to traverse
packages/react-reconciler/src/ReactFiberTreeReflection.js
+2
-1
@@ -24,6 +24,7 @@ import {
24
FundamentalComponent,
25
} from 'shared/ReactWorkTags';
26
import {NoEffect, Placement} from 'shared/ReactSideEffectTags';
27
+import {enableFundamentalAPI} from 'shared/ReactFeatureFlags';
28
29
const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
30
@@ -281,7 +282,7 @@ export function findCurrentHostFiberWithNoPortals(parent: Fiber): Fiber | null {
282
if (
283
node.tag === HostComponent ||
284
node.tag === HostText ||
284
- node.tag === FundamentalComponent
285
+ (enableFundamentalAPI && node.tag === FundamentalComponent)
286
) {
287
return node;
288
} else if (node.child && node.tag !== HostPortal) {