Revert "update hideOrUnhideAllChildren to hide portals that aren't wrapped in a host component (#16992)" (#17011)

This reverts commit de2edc268d.
This commit is contained in:
Luna Ruan
2019-10-03 17:22:22 -07:00
committed by GitHub
parent 3a2b5f148d
commit 4bc52ef0df
2 changed files with 0 additions and 30 deletions
@@ -104,29 +104,6 @@ describe('ReactDOMSuspensePlaceholder', () => {
expect(window.getComputedStyle(divs[2].current).display).toEqual('inline');
});
it('hides and unhides child portals', async () => {
const portalContainer = document.createElement('div');
function Component() {
return ReactDOM.createPortal(<span />, portalContainer);
}
function App() {
return (
<Suspense fallback={<Text text="Loading..." />}>
<AsyncText ms={500} text="A" />
<Component />
</Suspense>
);
}
ReactDOM.render(<App />, container);
expect(window.getComputedStyle(portalContainer).display).toEqual('none');
await advanceTimers(500);
Scheduler.unstable_flushAll();
expect(window.getComputedStyle(portalContainer).display).toEqual('block');
});
it('hides and unhides timed out text nodes', async () => {
function App() {
return (
-7
View File
@@ -645,13 +645,6 @@ function hideOrUnhideAllChildren(finishedWork, isHidden) {
} else {
unhideInstance(node.stateNode, node.memoizedProps);
}
} else if (node.tag === HostPortal) {
const instance = node.stateNode.containerInfo;
if (isHidden) {
hideInstance(instance);
} else {
unhideInstance(instance, node.memoizedProps);
}
} else if (node.tag === HostText) {
const instance = node.stateNode;
if (isHidden) {