Skip to content

Commit

Permalink
Ensure Fundamental flags are added to more locations (#16311)
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm authored Aug 7, 2019
1 parent 9dfe973 commit 028c07f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberCommitWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ function commitPlacement(finishedWork: Fiber): void {
let node: Fiber = finishedWork;
while (true) {
const isHost = node.tag === HostComponent || node.tag === HostText;
if (isHost || node.tag === FundamentalComponent) {
if (isHost || (enableFundamentalAPI && node.tag === FundamentalComponent)) {
const stateNode = isHost ? node.stateNode : node.stateNode.instance;
if (before) {
if (isContainer) {
Expand Down Expand Up @@ -1144,7 +1144,7 @@ function unmountHostComponents(current, renderPriorityLevel): void {
);
}
// Don't visit children because we already visited them.
} else if (node.tag === FundamentalComponent) {
} else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
const fundamentalNode = node.stateNode.instance;
commitNestedUnmounts(node, renderPriorityLevel);
// After all the children have unmounted, it is now safe to remove the
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberCompleteWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ if (supportsMutation) {
while (node !== null) {
if (node.tag === HostComponent || node.tag === HostText) {
appendInitialChild(parent, node.stateNode);
} else if (node.tag === FundamentalComponent) {
} else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
appendInitialChild(parent, node.stateNode.instance);
} else if (node.tag === HostPortal) {
// If we have a portal child, then we don't want to traverse
Expand Down
3 changes: 2 additions & 1 deletion packages/react-reconciler/src/ReactFiberTreeReflection.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
FundamentalComponent,
} from 'shared/ReactWorkTags';
import {NoEffect, Placement} from 'shared/ReactSideEffectTags';
import {enableFundamentalAPI} from 'shared/ReactFeatureFlags';

const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;

Expand Down Expand Up @@ -281,7 +282,7 @@ export function findCurrentHostFiberWithNoPortals(parent: Fiber): Fiber | null {
if (
node.tag === HostComponent ||
node.tag === HostText ||
node.tag === FundamentalComponent
(enableFundamentalAPI && node.tag === FundamentalComponent)
) {
return node;
} else if (node.child && node.tag !== HostPortal) {
Expand Down

0 comments on commit 028c07f

Please sign in to comment.