mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Ensure Fundamental flags are added to more locations (#16311)
This commit is contained in:
+2
-2
@@ -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
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user