Skip to content

Commit 4bc52ef

Browse files
authored
Revert "update hideOrUnhideAllChildren to hide portals that aren't wrapped in a host component (#16992)" (#17011)
This reverts commit de2edc2.
1 parent 3a2b5f1 commit 4bc52ef

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

packages/react-dom/src/__tests__/ReactDOMSuspensePlaceholder-test.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -104,29 +104,6 @@ describe('ReactDOMSuspensePlaceholder', () => {
104104
expect(window.getComputedStyle(divs[2].current).display).toEqual('inline');
105105
});
106106

107-
it('hides and unhides child portals', async () => {
108-
const portalContainer = document.createElement('div');
109-
function Component() {
110-
return ReactDOM.createPortal(<span />, portalContainer);
111-
}
112-
113-
function App() {
114-
return (
115-
<Suspense fallback={<Text text="Loading..." />}>
116-
<AsyncText ms={500} text="A" />
117-
<Component />
118-
</Suspense>
119-
);
120-
}
121-
122-
ReactDOM.render(<App />, container);
123-
expect(window.getComputedStyle(portalContainer).display).toEqual('none');
124-
125-
await advanceTimers(500);
126-
Scheduler.unstable_flushAll();
127-
expect(window.getComputedStyle(portalContainer).display).toEqual('block');
128-
});
129-
130107
it('hides and unhides timed out text nodes', async () => {
131108
function App() {
132109
return (

packages/react-reconciler/src/ReactFiberCommitWork.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -645,13 +645,6 @@ function hideOrUnhideAllChildren(finishedWork, isHidden) {
645645
} else {
646646
unhideInstance(node.stateNode, node.memoizedProps);
647647
}
648-
} else if (node.tag === HostPortal) {
649-
const instance = node.stateNode.containerInfo;
650-
if (isHidden) {
651-
hideInstance(instance);
652-
} else {
653-
unhideInstance(instance, node.memoizedProps);
654-
}
655648
} else if (node.tag === HostText) {
656649
const instance = node.stateNode;
657650
if (isHidden) {

0 commit comments

Comments
 (0)