Ensure Fundamental flags are added to more locations (#16311)

This commit is contained in:
Dominic Gannaway
2019-08-07 14:48:30 +01:00
committed by GitHub
parent 9dfe973b52
commit 028c07f89c
3 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -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) {
@@ -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
+1 -1
View File
@@ -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
+2 -1
View File
@@ -24,6 +24,7 @@ import {
FundamentalComponent,
} from 'shared/ReactWorkTags';
import {NoEffect, Placement} from 'shared/ReactSideEffectTags';
import {enableFundamentalAPI} from 'shared/ReactFeatureFlags';
const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
@@ -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) {