Skip to content

Commit

Permalink
Revert "update hideOrUnhideAllChildren to hide portals that aren't wr…
Browse files Browse the repository at this point in the history
…apped in a host component (#16992)" (#17011)

This reverts commit de2edc2.
  • Loading branch information
lunaruan authored Oct 4, 2019
1 parent 3a2b5f1 commit 4bc52ef
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
7 changes: 0 additions & 7 deletions packages/react-reconciler/src/ReactFiberCommitWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4bc52ef

Please sign in to comment.