Skip to content

Commit df91473

Browse files
committed
only container manipulation when float is off
1 parent 93f4dba commit df91473

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

packages/react-dom/src/client/ReactDOMRoot.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import type {
1515

1616
import {queueExplicitHydrationTarget} from '../events/ReactDOMEventReplaying';
1717
import {REACT_ELEMENT_TYPE} from 'shared/ReactSymbols';
18+
import {enableFloat} from 'shared/ReactFeatureFlags';
1819

1920
export type RootType = {
2021
render(children: ReactNodeList): void,
@@ -118,7 +119,7 @@ ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = functio
118119

119120
const container = root.containerInfo;
120121

121-
if (container.nodeType !== COMMENT_NODE) {
122+
if (!enableFloat && container.nodeType !== COMMENT_NODE) {
122123
const hostInstance = findHostInstanceWithNoPortals(root.current);
123124
if (hostInstance) {
124125
if (hostInstance.parentNode !== container) {

packages/react-reconciler/src/ReactFiberTreeReflection.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
SuspenseComponent,
2525
} from './ReactWorkTags';
2626
import {NoFlags, Placement, Hydrating} from './ReactFiberFlags';
27-
import {supportsHydration, isHydratableResource} from './ReactFiberHostConfig';
2827

2928
const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
3029

@@ -276,15 +275,7 @@ export function findCurrentHostFiber(parent: Fiber): Fiber | null {
276275
function findCurrentHostFiberImpl(node: Fiber) {
277276
// Next we'll drill down this component to find the first HostComponent/Text.
278277
if (node.tag === HostComponent || node.tag === HostText) {
279-
if (
280-
enableFloat &&
281-
supportsHydration &&
282-
isHydratableResource(node.type, node.memoizedProps)
283-
) {
284-
// This is a crude opt out of Resources from this search algorithm
285-
} else {
286-
return node;
287-
}
278+
return node;
288279
}
289280

290281
let child = node.child;
@@ -309,15 +300,7 @@ export function findCurrentHostFiberWithNoPortals(parent: Fiber): Fiber | null {
309300
function findCurrentHostFiberWithNoPortalsImpl(node: Fiber) {
310301
// Next we'll drill down this component to find the first HostComponent/Text.
311302
if (node.tag === HostComponent || node.tag === HostText) {
312-
if (
313-
enableFloat &&
314-
supportsHydration &&
315-
isHydratableResource(node.type, node.memoizedProps)
316-
) {
317-
// This is a crude opt out of Resources from this search algorithm
318-
} else {
319-
return node;
320-
}
303+
return node;
321304
}
322305

323306
let child = node.child;

0 commit comments

Comments
 (0)