diff --git a/packages/react-dom-bindings/src/client/ReactDOMComponent.js b/packages/react-dom-bindings/src/client/ReactDOMComponent.js
index edfb945c35fe9..a94c990733915 100644
--- a/packages/react-dom-bindings/src/client/ReactDOMComponent.js
+++ b/packages/react-dom-bindings/src/client/ReactDOMComponent.js
@@ -69,7 +69,6 @@ import {
enableCustomElementPropertySupport,
enableClientRenderFallbackOnTextMismatch,
enableFormActions,
- enableHostSingletons,
disableIEWorkarounds,
enableTrustedTypesIntegration,
enableFilterEmptyStringAttributesDOM,
@@ -394,8 +393,7 @@ function setProp(
// show within the
-
-
-
- server
-
- ,
- );
- pipe(writable);
- });
- const errors = [];
- ReactDOMClient.hydrateRoot(
- document,
-
-
-
-
-
- client
- ,
- {
- onRecoverableError(error) {
- errors.push(error.message);
- },
- },
- );
- await expect(async () => {
- await waitForAll([]);
- }).toErrorDev(
- [
- 'Warning: Text content did not match. Server: "server" Client: "client"',
- 'Warning: An error occurred during hydration. The server HTML was replaced with client content in <#document>.',
- ],
- {withoutStack: 1},
- );
- expect(getMeaningfulChildren(document)).toEqual(
-
-
-
-
-
- client
- ,
- );
- });
-
- // @gate enableFloat && enableHostSingletons
+ // @gate enableFloat
it('retains styles in head through head remounts', async () => {
const root = ReactDOMClient.createRoot(document);
root.render(
@@ -8114,7 +8063,7 @@ background-color: green;
]);
});
- // @gate enableFloat && enableHostSingletons && (enableClientRenderFallbackOnTextMismatch || !__DEV__)
+ // @gate enableFloat && (enableClientRenderFallbackOnTextMismatch || !__DEV__)
it('can render a title before a singleton even if that singleton clears its contents', async () => {
await act(() => {
const {pipe} = renderToPipeableStream(
diff --git a/packages/react-dom/src/__tests__/ReactDOMRoot-test.js b/packages/react-dom/src/__tests__/ReactDOMRoot-test.js
index c601691c96873..8a241135269fe 100644
--- a/packages/react-dom/src/__tests__/ReactDOMRoot-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMRoot-test.js
@@ -375,7 +375,7 @@ describe('ReactDOMRoot', () => {
await waitForAll([]);
container.innerHTML = '';
- if (gate(flags => flags.enableFloat || flags.enableHostSingletons)) {
+ if (gate(flags => flags.enableFloat)) {
// When either of these flags are on this validation is turned off so we
// expect there to be no warnings
root.render(Hi
);
diff --git a/packages/react-dom/src/__tests__/ReactDOMSingletonComponents-test.js b/packages/react-dom/src/__tests__/ReactDOMSingletonComponents-test.js
index 7d1bddbe661c2..9c4c3fc913be1 100644
--- a/packages/react-dom/src/__tests__/ReactDOMSingletonComponents-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMSingletonComponents-test.js
@@ -123,7 +123,7 @@ describe('ReactDOM HostSingleton', () => {
: children;
}
- // @gate enableHostSingletons && enableFloat
+ // @gate enableFloat
it('warns if you render the same singleton twice at the same time', async () => {
const root = ReactDOMClient.createRoot(document);
root.render(
@@ -208,16 +208,8 @@ describe('ReactDOM HostSingleton', () => {
);
});
- // @gate enableHostSingletons && enableFloat
+ // @gate enableFloat
it('renders into html, head, and body persistently so the node identities never change and extraneous styles are retained', async () => {
- gate(flags => {
- if (flags.enableHostSingletons !== true) {
- // We throw here because when this test fails it ends up with sync work in a microtask
- // that throws after the expectTestToFail check asserts the failure. this causes even the
- // expected failure to fail. This just fails explicitly and early
- throw new Error('manually opting out of test');
- }
- });
// Server render some html that will get replaced with a client render
await actIntoEmptyDocument(() => {
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
@@ -601,7 +593,6 @@ describe('ReactDOM HostSingleton', () => {
});
// This test is not supported in this implementation. If we reintroduce insertion edge we should revisit
- // @gate enableHostSingletons
xit('is able to maintain insertions in head and body between tree-adjacent Nodes', async () => {
// Server render some html and hydrate on the client
await actIntoEmptyDocument(() => {
@@ -732,7 +723,6 @@ describe('ReactDOM HostSingleton', () => {
);
});
- // @gate enableHostSingletons
it('clears persistent head and body when html is the container', async () => {
await actIntoEmptyDocument(() => {
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
@@ -785,7 +775,6 @@ describe('ReactDOM HostSingleton', () => {
);
});
- // @gate enableHostSingletons
it('clears persistent head when it is the container', async () => {
await actIntoEmptyDocument(() => {
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
@@ -817,7 +806,7 @@ describe('ReactDOM HostSingleton', () => {
);
});
- // @gate enableHostSingletons && enableFloat
+ // @gate enableFloat
it('clears persistent body when it is the container', async () => {
await actIntoEmptyDocument(() => {
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
@@ -974,7 +963,6 @@ describe('ReactDOM HostSingleton', () => {
);
});
- // @gate enableHostSingletons
it('allows for hydrating without a head', async () => {
await actIntoEmptyDocument(() => {
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
diff --git a/packages/react-dom/src/__tests__/ReactMount-test.js b/packages/react-dom/src/__tests__/ReactMount-test.js
index df92131a7cb17..b679466b25a30 100644
--- a/packages/react-dom/src/__tests__/ReactMount-test.js
+++ b/packages/react-dom/src/__tests__/ReactMount-test.js
@@ -149,17 +149,8 @@ describe('ReactMount', () => {
const iFrame = document.createElement('iframe');
document.body.appendChild(iFrame);
- if (gate(flags => flags.enableHostSingletons)) {
- // HostSingletons make the warning for document.body unecessary
- ReactDOM.render(, iFrame.contentDocument.body);
- } else {
- expect(() =>
- ReactDOM.render(, iFrame.contentDocument.body),
- ).toErrorDev(
- 'Rendering components directly into document.body is discouraged',
- {withoutStack: true},
- );
- }
+ // HostSingletons make the warning for document.body unecessary
+ ReactDOM.render(, iFrame.contentDocument.body);
});
it('should account for escaping on a checksum mismatch', () => {
diff --git a/packages/react-dom/src/__tests__/ReactRenderDocument-test.js b/packages/react-dom/src/__tests__/ReactRenderDocument-test.js
index a746e5e9f0075..1ca24a5cdb39a 100644
--- a/packages/react-dom/src/__tests__/ReactRenderDocument-test.js
+++ b/packages/react-dom/src/__tests__/ReactRenderDocument-test.js
@@ -62,7 +62,6 @@ describe('rendering React components at document', () => {
expect(body === testDocument.body).toBe(true);
});
- // @gate enableHostSingletons
it('should be able to unmount component from document node, but leaves singleton nodes intact', () => {
class Root extends React.Component {
render() {
@@ -95,31 +94,6 @@ describe('rendering React components at document', () => {
expect(originalHead.firstChild).toEqual(null);
});
- // @gate !enableHostSingletons
- it('should be able to unmount component from document node', () => {
- class Root extends React.Component {
- render() {
- return (
-
-
- Hello World
-
- Hello world
-
- );
- }
- }
-
- const markup = ReactDOMServer.renderToString();
- const testDocument = getTestDocument(markup);
- ReactDOM.hydrate(, testDocument);
- expect(testDocument.body.innerHTML).toBe('Hello world');
-
- // When we unmount everything is removed except the persistent nodes of html, head, and body
- ReactDOM.unmountComponentAtNode(testDocument);
- expect(testDocument.firstChild).toBe(null);
- });
-
it('should not be able to switch root constructors', () => {
class Component extends React.Component {
render() {
diff --git a/packages/react-dom/src/__tests__/validateDOMNesting-test.js b/packages/react-dom/src/__tests__/validateDOMNesting-test.js
index ca1d921134785..da7c7f3acb96a 100644
--- a/packages/react-dom/src/__tests__/validateDOMNesting-test.js
+++ b/packages/react-dom/src/__tests__/validateDOMNesting-test.js
@@ -38,15 +38,7 @@ function expectWarnings(tags, warnings = [], withoutStack = 0) {
describe('validateDOMNesting', () => {
it('allows valid nestings', () => {
expectWarnings(['table', 'tbody', 'tr', 'td', 'b']);
- expectWarnings(
- ['body', 'datalist', 'option'],
- [
- gate(flags => !flags.enableHostSingletons)
- ? 'render(): Rendering components directly into document.body is discouraged'
- : null,
- ].filter(Boolean),
- 1,
- );
+ expectWarnings(['body', 'datalist', 'option']);
expectWarnings(['div', 'a', 'object', 'a']);
expectWarnings(['div', 'p', 'button', 'p']);
expectWarnings(['p', 'svg', 'foreignObject', 'p']);
@@ -106,45 +98,22 @@ describe('validateDOMNesting', () => {
' in html (at **)',
],
);
- if (gate(flags => flags.enableHostSingletons)) {
- expectWarnings(
- ['body', 'body'],
- [
- 'validateDOMNesting(...): cannot appear as a child of .\n' +
- ' in body (at **)',
- ],
- );
- } else {
- expectWarnings(
- ['body', 'body'],
- [
- 'render(): Rendering components directly into document.body is discouraged',
- 'validateDOMNesting(...): cannot appear as a child of .\n' +
- ' in body (at **)',
- ],
- 1,
- );
- }
- if (gate(flags => flags.enableHostSingletons)) {
- expectWarnings(
- ['svg', 'foreignObject', 'body', 'p'],
- [
- 'validateDOMNesting(...): cannot appear as a child of .\n' +
- ' in body (at **)\n' +
- ' in foreignObject (at **)',
- 'Warning: You are mounting a new body component when a previous one has not first unmounted. It is an error to render more than one body component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of and if you need to mount a new one, ensure any previous ones have unmounted first.\n' +
- ' in body (at **)',
- ],
- );
- } else {
- expectWarnings(
- ['svg', 'foreignObject', 'body', 'p'],
- [
- 'validateDOMNesting(...): cannot appear as a child of .\n' +
- ' in body (at **)\n' +
- ' in foreignObject (at **)',
- ],
- );
- }
+ expectWarnings(
+ ['body', 'body'],
+ [
+ 'validateDOMNesting(...): cannot appear as a child of .\n' +
+ ' in body (at **)',
+ ],
+ );
+ expectWarnings(
+ ['svg', 'foreignObject', 'body', 'p'],
+ [
+ 'validateDOMNesting(...): cannot appear as a child of .\n' +
+ ' in body (at **)\n' +
+ ' in foreignObject (at **)',
+ 'Warning: You are mounting a new body component when a previous one has not first unmounted. It is an error to render more than one body component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of and if you need to mount a new one, ensure any previous ones have unmounted first.\n' +
+ ' in body (at **)',
+ ],
+ );
});
});
diff --git a/packages/react-dom/src/client/ReactDOMLegacy.js b/packages/react-dom/src/client/ReactDOMLegacy.js
index ce0c9ff609ebd..4937ce3f96c0a 100644
--- a/packages/react-dom/src/client/ReactDOMLegacy.js
+++ b/packages/react-dom/src/client/ReactDOMLegacy.js
@@ -43,7 +43,6 @@ import {LegacyRoot} from 'react-reconciler/src/ReactRootTags';
import getComponentNameFromType from 'shared/getComponentNameFromType';
import ReactSharedInternals from 'shared/ReactSharedInternals';
import {has as hasInstance} from 'shared/ReactInstanceMap';
-import {enableHostSingletons} from '../../../shared/ReactFeatureFlags';
const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
@@ -79,21 +78,6 @@ if (__DEV__) {
'and render the new components instead of calling ReactDOM.render.',
);
}
-
- if (
- !enableHostSingletons &&
- container.nodeType === ELEMENT_NODE &&
- ((container: any): Element).tagName &&
- ((container: any): Element).tagName.toUpperCase() === 'BODY'
- ) {
- console.error(
- 'render(): Rendering components directly into document.body is ' +
- 'discouraged, since its children are often manipulated by third-party ' +
- 'scripts and browser extensions. This may lead to subtle ' +
- 'reconciliation issues. Try rendering into a container element created ' +
- 'for your app.',
- );
- }
};
}
diff --git a/packages/react-dom/src/client/ReactDOMRoot.js b/packages/react-dom/src/client/ReactDOMRoot.js
index ea36929cac5e5..0e3579eb379ae 100644
--- a/packages/react-dom/src/client/ReactDOMRoot.js
+++ b/packages/react-dom/src/client/ReactDOMRoot.js
@@ -18,7 +18,6 @@ import {queueExplicitHydrationTarget} from 'react-dom-bindings/src/events/ReactD
import {REACT_ELEMENT_TYPE} from 'shared/ReactSymbols';
import {
enableFloat,
- enableHostSingletons,
allowConcurrentByDefault,
disableCommentsAsDOMContainers,
enableAsyncActions,
@@ -78,7 +77,6 @@ import {
createContainer,
createHydrationContainer,
updateContainer,
- findHostInstanceWithNoPortals,
flushSync,
isAlreadyRendering,
} from 'react-reconciler/src/ReactFiberReconciler';
@@ -127,26 +125,6 @@ ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render =
'one argument.',
);
}
-
- const container = root.containerInfo;
-
- if (
- !enableFloat &&
- !enableHostSingletons &&
- container.nodeType !== COMMENT_NODE
- ) {
- const hostInstance = findHostInstanceWithNoPortals(root.current);
- if (hostInstance) {
- if (hostInstance.parentNode !== container) {
- console.error(
- 'render(...): It looks like the React-rendered content of the ' +
- 'root container was removed without using React. This is not ' +
- 'supported and will cause errors. Instead, call ' +
- "root.unmount() to empty a root's container.",
- );
- }
- }
- }
}
updateContainer(children, root, null, null);
};
@@ -381,20 +359,6 @@ export function isValidContainerLegacy(node: any): boolean {
function warnIfReactDOMContainerInDEV(container: any) {
if (__DEV__) {
- if (
- !enableHostSingletons &&
- container.nodeType === ELEMENT_NODE &&
- ((container: any): Element).tagName &&
- ((container: any): Element).tagName.toUpperCase() === 'BODY'
- ) {
- console.error(
- 'createRoot(): Creating roots directly with document.body is ' +
- 'discouraged, since its children are often manipulated by third-party ' +
- 'scripts and browser extensions. This may lead to subtle ' +
- 'reconciliation issues. Try using a container element created ' +
- 'for your app.',
- );
- }
if (isContainerMarkedAsRoot(container)) {
if (container._reactRootContainer) {
console.error(
diff --git a/packages/react-dom/src/test-utils/ReactTestUtils.js b/packages/react-dom/src/test-utils/ReactTestUtils.js
index 04a69bcd81a69..568e8327198f1 100644
--- a/packages/react-dom/src/test-utils/ReactTestUtils.js
+++ b/packages/react-dom/src/test-utils/ReactTestUtils.js
@@ -25,7 +25,7 @@ import {
rethrowCaughtError,
invokeGuardedCallbackAndCatchFirstError,
} from 'shared/ReactErrorUtils';
-import {enableFloat, enableHostSingletons} from 'shared/ReactFeatureFlags';
+import {enableFloat} from 'shared/ReactFeatureFlags';
import assign from 'shared/assign';
import isArray from 'shared/isArray';
@@ -66,7 +66,7 @@ function findAllInRenderedFiberTreeInternal(fiber, test) {
node.tag === ClassComponent ||
node.tag === FunctionComponent ||
(enableFloat ? node.tag === HostHoistable : false) ||
- (enableHostSingletons ? node.tag === HostSingleton : false)
+ node.tag === HostSingleton
) {
const publicInst = node.stateNode;
if (test(publicInst)) {
@@ -419,11 +419,7 @@ function getParent(inst) {
// events to their parent. We could also go through parentNode on the
// host node but that wouldn't work for React Native and doesn't let us
// do the portal feature.
- } while (
- inst &&
- inst.tag !== HostComponent &&
- (!enableHostSingletons ? true : inst.tag !== HostSingleton)
- );
+ } while (inst && inst.tag !== HostComponent && inst.tag !== HostSingleton);
if (inst) {
return inst;
}
diff --git a/packages/react-reconciler/src/ReactFiber.js b/packages/react-reconciler/src/ReactFiber.js
index de626f2b72f63..53d7bc601aa05 100644
--- a/packages/react-reconciler/src/ReactFiber.js
+++ b/packages/react-reconciler/src/ReactFiber.js
@@ -38,7 +38,6 @@ import {
enableTransitionTracing,
enableDebugTracing,
enableFloat,
- enableHostSingletons,
enableDO_NOT_USE_disableStrictPassiveEffect,
} from 'shared/ReactFeatureFlags';
import {NoFlags, Placement, StaticMask} from './ReactFiberFlags';
@@ -510,12 +509,7 @@ export function createFiberFromTypeAndProps(
}
}
} else if (typeof type === 'string') {
- if (
- enableFloat &&
- supportsResources &&
- enableHostSingletons &&
- supportsSingletons
- ) {
+ if (enableFloat && supportsResources && supportsSingletons) {
const hostContext = getHostContext();
fiberTag = isHostHoistableType(type, pendingProps, hostContext)
? HostHoistable
@@ -527,7 +521,7 @@ export function createFiberFromTypeAndProps(
fiberTag = isHostHoistableType(type, pendingProps, hostContext)
? HostHoistable
: HostComponent;
- } else if (enableHostSingletons && supportsSingletons) {
+ } else if (supportsSingletons) {
fiberTag = isHostSingletonType(type) ? HostSingleton : HostComponent;
} else {
fiberTag = HostComponent;
diff --git a/packages/react-reconciler/src/ReactFiberBeginWork.js b/packages/react-reconciler/src/ReactFiberBeginWork.js
index 180187a8775ff..dc77d68a38835 100644
--- a/packages/react-reconciler/src/ReactFiberBeginWork.js
+++ b/packages/react-reconciler/src/ReactFiberBeginWork.js
@@ -106,7 +106,6 @@ import {
enableLegacyHidden,
enableCPUSuspense,
enableFloat,
- enableHostSingletons,
enableFormActions,
enableAsyncActions,
enablePostpone,
@@ -4152,7 +4151,7 @@ function beginWork(
}
// Fall through
case HostSingleton:
- if (enableHostSingletons && supportsSingletons) {
+ if (supportsSingletons) {
return updateHostSingleton(current, workInProgress, renderLanes);
}
// Fall through
diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.js b/packages/react-reconciler/src/ReactFiberCommitWork.js
index 79cd32c4e42a9..13cece7ed9368 100644
--- a/packages/react-reconciler/src/ReactFiberCommitWork.js
+++ b/packages/react-reconciler/src/ReactFiberCommitWork.js
@@ -53,7 +53,6 @@ import {
enableUseEffectEventHook,
enableFloat,
enableLegacyHidden,
- enableHostSingletons,
alwaysThrottleRetries,
} from 'shared/ReactFeatureFlags';
import {
@@ -1527,9 +1526,7 @@ function hideOrUnhideAllChildren(finishedWork: Fiber, isHidden: boolean) {
(enableFloat && supportsResources
? node.tag === HostHoistable
: false) ||
- (enableHostSingletons && supportsSingletons
- ? node.tag === HostSingleton
- : false)
+ (supportsSingletons ? node.tag === HostSingleton : false)
) {
if (hostSubtreeRoot === null) {
hostSubtreeRoot = node;
@@ -1748,9 +1745,7 @@ function isHostParent(fiber: Fiber): boolean {
fiber.tag === HostComponent ||
fiber.tag === HostRoot ||
(enableFloat && supportsResources ? fiber.tag === HostHoistable : false) ||
- (enableHostSingletons && supportsSingletons
- ? fiber.tag === HostSingleton
- : false) ||
+ (supportsSingletons ? fiber.tag === HostSingleton : false) ||
fiber.tag === HostPortal
);
}
@@ -1777,9 +1772,7 @@ function getHostSibling(fiber: Fiber): ?Instance {
while (
node.tag !== HostComponent &&
node.tag !== HostText &&
- (!(enableHostSingletons && supportsSingletons)
- ? true
- : node.tag !== HostSingleton) &&
+ (!supportsSingletons ? true : node.tag !== HostSingleton) &&
node.tag !== DehydratedFragment
) {
// If it is not host node and, we might have a host node inside it.
@@ -1810,7 +1803,7 @@ function commitPlacement(finishedWork: Fiber): void {
return;
}
- if (enableHostSingletons && supportsSingletons) {
+ if (supportsSingletons) {
if (finishedWork.tag === HostSingleton) {
// Singletons are already in the Host and don't need to be placed
// Since they operate somewhat like Portals though their children will
@@ -1823,7 +1816,7 @@ function commitPlacement(finishedWork: Fiber): void {
switch (parentFiber.tag) {
case HostSingleton: {
- if (enableHostSingletons && supportsSingletons) {
+ if (supportsSingletons) {
const parent: Instance = parentFiber.stateNode;
const before = getHostSibling(finishedWork);
// We only have the top Fiber that was inserted but we need to recurse down its
@@ -1879,7 +1872,7 @@ function insertOrAppendPlacementNodeIntoContainer(
}
} else if (
tag === HostPortal ||
- (enableHostSingletons && supportsSingletons ? tag === HostSingleton : false)
+ (supportsSingletons ? tag === HostSingleton : false)
) {
// If the insertion itself is a portal, then we don't want to traverse
// down its children. Instead, we'll get insertions from each child in
@@ -1914,7 +1907,7 @@ function insertOrAppendPlacementNode(
}
} else if (
tag === HostPortal ||
- (enableHostSingletons && supportsSingletons ? tag === HostSingleton : false)
+ (supportsSingletons ? tag === HostSingleton : false)
) {
// If the insertion itself is a portal, then we don't want to traverse
// down its children. Instead, we'll get insertions from each child in
@@ -2048,7 +2041,7 @@ function commitDeletionEffectsOnFiber(
// Fall through
}
case HostSingleton: {
- if (enableHostSingletons && supportsSingletons) {
+ if (supportsSingletons) {
if (!offscreenSubtreeWasHidden) {
safelyDetachRef(deletedFiber, nearestMountedAncestor);
}
@@ -2711,7 +2704,7 @@ function commitMutationEffectsOnFiber(
// Fall through
}
case HostSingleton: {
- if (enableHostSingletons && supportsSingletons) {
+ if (supportsSingletons) {
if (flags & Update) {
const previousWork = finishedWork.alternate;
if (previousWork === null) {
diff --git a/packages/react-reconciler/src/ReactFiberCompleteWork.js b/packages/react-reconciler/src/ReactFiberCompleteWork.js
index 411dee4c0b0bf..78dd30cd5f325 100644
--- a/packages/react-reconciler/src/ReactFiberCompleteWork.js
+++ b/packages/react-reconciler/src/ReactFiberCompleteWork.js
@@ -33,7 +33,6 @@ import type {TracingMarkerInstance} from './ReactFiberTracingMarkerComponent';
import type {Cache} from './ReactFiberCacheComponent';
import {
enableLegacyHidden,
- enableHostSingletons,
enableSuspenseCallback,
enableScopeAPI,
enableProfilerTimer,
@@ -233,9 +232,7 @@ function appendAllChildren(
appendInitialChild(parent, node.stateNode);
} else if (
node.tag === HostPortal ||
- (enableHostSingletons && supportsSingletons
- ? node.tag === HostSingleton
- : false)
+ (supportsSingletons ? node.tag === HostSingleton : false)
) {
// If we have a portal child, then we don't want to traverse
// down its children. Instead, we'll get insertions from each child in
@@ -1177,7 +1174,7 @@ function completeWork(
// Fall through
}
case HostSingleton: {
- if (enableHostSingletons && supportsSingletons) {
+ if (supportsSingletons) {
popHostContext(workInProgress);
const rootContainerInstance = getRootHostContainer();
const type = workInProgress.type;
diff --git a/packages/react-reconciler/src/ReactFiberHotReloading.js b/packages/react-reconciler/src/ReactFiberHotReloading.js
index 3bc3755bb957a..090f1311b4453 100644
--- a/packages/react-reconciler/src/ReactFiberHotReloading.js
+++ b/packages/react-reconciler/src/ReactFiberHotReloading.js
@@ -14,7 +14,7 @@ import type {Fiber, FiberRoot} from './ReactInternalTypes';
import type {Instance} from './ReactFiberConfig';
import type {ReactNodeList} from 'shared/ReactTypes';
-import {enableHostSingletons, enableFloat} from 'shared/ReactFeatureFlags';
+import {enableFloat} from 'shared/ReactFeatureFlags';
import {
flushSync,
scheduleUpdateOnFiber,
@@ -469,9 +469,7 @@ function findChildHostInstancesForFiberShallowly(
if (
node.tag === HostComponent ||
(enableFloat ? node.tag === HostHoistable : false) ||
- (enableHostSingletons && supportsSingletons
- ? node.tag === HostSingleton
- : false)
+ (supportsSingletons ? node.tag === HostSingleton : false)
) {
// We got a match.
foundHostInstances = true;
diff --git a/packages/react-reconciler/src/ReactFiberHydrationContext.js b/packages/react-reconciler/src/ReactFiberHydrationContext.js
index c1ee83c2c8e71..a0838ea331b3c 100644
--- a/packages/react-reconciler/src/ReactFiberHydrationContext.js
+++ b/packages/react-reconciler/src/ReactFiberHydrationContext.js
@@ -35,10 +35,7 @@ import {
NoFlags,
DidCapture,
} from './ReactFiberFlags';
-import {
- enableHostSingletons,
- enableClientRenderFallbackOnTextMismatch,
-} from 'shared/ReactFeatureFlags';
+import {enableClientRenderFallbackOnTextMismatch} from 'shared/ReactFeatureFlags';
import {
createFiberFromHostInstanceForDeletion,
@@ -426,7 +423,7 @@ function throwOnHydrationMismatch(fiber: Fiber) {
}
function claimHydratableSingleton(fiber: Fiber): void {
- if (enableHostSingletons && supportsSingletons) {
+ if (supportsSingletons) {
if (!isHydrating) {
return;
}
@@ -801,7 +798,7 @@ function popHydrationState(fiber: Fiber): boolean {
}
let shouldClear = false;
- if (enableHostSingletons && supportsSingletons) {
+ if (supportsSingletons) {
// With float we never clear the Root, or Singleton instances. We also do not clear Instances
// that have singleton text content
if (
diff --git a/packages/react-reconciler/src/ReactFiberTreeReflection.js b/packages/react-reconciler/src/ReactFiberTreeReflection.js
index 8828017eee8d3..c5c5944efda6b 100644
--- a/packages/react-reconciler/src/ReactFiberTreeReflection.js
+++ b/packages/react-reconciler/src/ReactFiberTreeReflection.js
@@ -25,7 +25,7 @@ import {
SuspenseComponent,
} from './ReactWorkTags';
import {NoFlags, Placement, Hydrating} from './ReactFiberFlags';
-import {enableFloat, enableHostSingletons} from 'shared/ReactFeatureFlags';
+import {enableFloat} from 'shared/ReactFeatureFlags';
const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
@@ -281,7 +281,7 @@ function findCurrentHostFiberImpl(node: Fiber): Fiber | null {
if (
tag === HostComponent ||
(enableFloat ? tag === HostHoistable : false) ||
- (enableHostSingletons ? tag === HostSingleton : false) ||
+ tag === HostSingleton ||
tag === HostText
) {
return node;
@@ -312,7 +312,7 @@ function findCurrentHostFiberWithNoPortalsImpl(node: Fiber): Fiber | null {
if (
tag === HostComponent ||
(enableFloat ? tag === HostHoistable : false) ||
- (enableHostSingletons ? tag === HostSingleton : false) ||
+ tag === HostSingleton ||
tag === HostText
) {
return node;
diff --git a/packages/shared/ReactFeatureFlags.js b/packages/shared/ReactFeatureFlags.js
index 7411bc7d9a92c..2ede92b1c06e0 100644
--- a/packages/shared/ReactFeatureFlags.js
+++ b/packages/shared/ReactFeatureFlags.js
@@ -105,8 +105,6 @@ export const enableSuspenseAvoidThisFallbackFizz = false;
export const enableCPUSuspense = __EXPERIMENTAL__;
-export const enableHostSingletons = true;
-
export const enableFloat = true;
// Enables unstable_useMemoCache hook, intended as a compilation target for
diff --git a/packages/shared/forks/ReactFeatureFlags.native-fb.js b/packages/shared/forks/ReactFeatureFlags.native-fb.js
index 0c04991e13b7d..5c224fd78271f 100644
--- a/packages/shared/forks/ReactFeatureFlags.native-fb.js
+++ b/packages/shared/forks/ReactFeatureFlags.native-fb.js
@@ -83,7 +83,6 @@ export const enableServerContext = false;
export const enableTransitionTracing = false;
export const enableFloat = true;
-export const enableHostSingletons = true;
export const useModernStrictMode = false;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
diff --git a/packages/shared/forks/ReactFeatureFlags.native-oss.js b/packages/shared/forks/ReactFeatureFlags.native-oss.js
index 70105f99ce48e..b8203b3b3cbcb 100644
--- a/packages/shared/forks/ReactFeatureFlags.native-oss.js
+++ b/packages/shared/forks/ReactFeatureFlags.native-oss.js
@@ -68,7 +68,6 @@ export const enableServerContext = false;
export const enableTransitionTracing = false;
export const enableFloat = true;
-export const enableHostSingletons = true;
export const useModernStrictMode = false;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.js
index 1f1766c61789a..611160e2a1f6a 100644
--- a/packages/shared/forks/ReactFeatureFlags.test-renderer.js
+++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.js
@@ -68,7 +68,6 @@ export const enableServerContext = false;
export const enableTransitionTracing = false;
export const enableFloat = true;
-export const enableHostSingletons = true;
export const useModernStrictMode = false;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js
index 18fa67530ad5d..60a15318c7c00 100644
--- a/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js
+++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js
@@ -66,7 +66,6 @@ export const enableServerContext = false;
export const enableTransitionTracing = false;
export const enableFloat = true;
-export const enableHostSingletons = true;
export const useModernStrictMode = false;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
index c4131e3312c54..c5678792313ae 100644
--- a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
+++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
@@ -68,7 +68,6 @@ export const enableServerContext = false;
export const enableTransitionTracing = false;
export const enableFloat = true;
-export const enableHostSingletons = true;
export const useModernStrictMode = false;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
diff --git a/packages/shared/forks/ReactFeatureFlags.www.js b/packages/shared/forks/ReactFeatureFlags.www.js
index a597b8e98058c..01ae3eae5935c 100644
--- a/packages/shared/forks/ReactFeatureFlags.www.js
+++ b/packages/shared/forks/ReactFeatureFlags.www.js
@@ -54,7 +54,6 @@ export const enableCPUSuspense = true;
export const enableFloat = true;
export const enableUseMemoCacheHook = true;
export const enableUseEffectEventHook = true;
-export const enableHostSingletons = true;
export const enableClientRenderFallbackOnTextMismatch = false;
export const enableFilterEmptyStringAttributesDOM = true;