Skip to content

Commit 028c07f

Browse files
authored
Ensure Fundamental flags are added to more locations (#16311)
1 parent 9dfe973 commit 028c07f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

packages/react-reconciler/src/ReactFiberCommitWork.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ function commitPlacement(finishedWork: Fiber): void {
10431043
let node: Fiber = finishedWork;
10441044
while (true) {
10451045
const isHost = node.tag === HostComponent || node.tag === HostText;
1046-
if (isHost || node.tag === FundamentalComponent) {
1046+
if (isHost || (enableFundamentalAPI && node.tag === FundamentalComponent)) {
10471047
const stateNode = isHost ? node.stateNode : node.stateNode.instance;
10481048
if (before) {
10491049
if (isContainer) {
@@ -1144,7 +1144,7 @@ function unmountHostComponents(current, renderPriorityLevel): void {
11441144
);
11451145
}
11461146
// Don't visit children because we already visited them.
1147-
} else if (node.tag === FundamentalComponent) {
1147+
} else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
11481148
const fundamentalNode = node.stateNode.instance;
11491149
commitNestedUnmounts(node, renderPriorityLevel);
11501150
// After all the children have unmounted, it is now safe to remove the

packages/react-reconciler/src/ReactFiberCompleteWork.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ if (supportsMutation) {
168168
while (node !== null) {
169169
if (node.tag === HostComponent || node.tag === HostText) {
170170
appendInitialChild(parent, node.stateNode);
171-
} else if (node.tag === FundamentalComponent) {
171+
} else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
172172
appendInitialChild(parent, node.stateNode.instance);
173173
} else if (node.tag === HostPortal) {
174174
// If we have a portal child, then we don't want to traverse

packages/react-reconciler/src/ReactFiberTreeReflection.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
FundamentalComponent,
2525
} from 'shared/ReactWorkTags';
2626
import {NoEffect, Placement} from 'shared/ReactSideEffectTags';
27+
import {enableFundamentalAPI} from 'shared/ReactFeatureFlags';
2728

2829
const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
2930

@@ -281,7 +282,7 @@ export function findCurrentHostFiberWithNoPortals(parent: Fiber): Fiber | null {
281282
if (
282283
node.tag === HostComponent ||
283284
node.tag === HostText ||
284-
node.tag === FundamentalComponent
285+
(enableFundamentalAPI && node.tag === FundamentalComponent)
285286
) {
286287
return node;
287288
} else if (node.child && node.tag !== HostPortal) {

0 commit comments

Comments
 (0)