GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Revert "Clean up host pointers in level 2 of clean-up flag (#21112)" · react/react@c670265

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-reconciler/src
    • ReactFiberCommitWork.new.js
    • ReactFiberCommitWork.old.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-reconciler/src/ReactFiberCommitWork.new.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberCommitWork.new.js
+9-12Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,18 +1382,6 @@ function detachFiberAfterEffects(fiber: Fiber) {
13821382
fiber.deletions = null;
13831383
fiber.sibling = null;
13841384

1385-
// The `stateNode` is cyclical because on host nodes it points to the host
1386-
// tree, which has its own pointers to children, parents, and siblings.
1387-
// The other host nodes also point back to fibers, so we should detach that
1388-
// one, too.
1389-
if (fiber.tag === HostComponent) {
1390-
const hostInstance: Instance = fiber.stateNode;
1391-
if (hostInstance !== null) {
1392-
detachDeletedInstance(hostInstance);
1393-
}
1394-
}
1395-
fiber.stateNode = null;
1396-
13971385
// I'm intentionally not clearing the `return` field in this level. We
13981386
// already disconnect the `return` pointer at the root of the deleted
13991387
// subtree (in `detachFiberMutation`). Besides, `return` by itself is not
@@ -1412,6 +1400,15 @@ function detachFiberAfterEffects(fiber: Fiber) {
14121400
// The purpose of this branch is to be super aggressive so we can measure
14131401
// if there's any difference in memory impact. If there is, that could
14141402
// indicate a React leak we don't know about.
1403+
1404+
// For host components, disconnect host instance -> fiber pointer.
1405+
if (fiber.tag === HostComponent) {
1406+
const hostInstance: Instance = fiber.stateNode;
1407+
if (hostInstance !== null) {
1408+
detachDeletedInstance(hostInstance);
1409+
}
1410+
}
1411+
14151412
fiber.return = null;
14161413
fiber.dependencies = null;
14171414
fiber.memoizedProps = null;
Collapse file

‎packages/react-reconciler/src/ReactFiberCommitWork.old.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberCommitWork.old.js
+9-12Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,18 +1382,6 @@ function detachFiberAfterEffects(fiber: Fiber) {
13821382
fiber.deletions = null;
13831383
fiber.sibling = null;
13841384

1385-
// The `stateNode` is cyclical because on host nodes it points to the host
1386-
// tree, which has its own pointers to children, parents, and siblings.
1387-
// The other host nodes also point back to fibers, so we should detach that
1388-
// one, too.
1389-
if (fiber.tag === HostComponent) {
1390-
const hostInstance: Instance = fiber.stateNode;
1391-
if (hostInstance !== null) {
1392-
detachDeletedInstance(hostInstance);
1393-
}
1394-
}
1395-
fiber.stateNode = null;
1396-
13971385
// I'm intentionally not clearing the `return` field in this level. We
13981386
// already disconnect the `return` pointer at the root of the deleted
13991387
// subtree (in `detachFiberMutation`). Besides, `return` by itself is not
@@ -1412,6 +1400,15 @@ function detachFiberAfterEffects(fiber: Fiber) {
14121400
// The purpose of this branch is to be super aggressive so we can measure
14131401
// if there's any difference in memory impact. If there is, that could
14141402
// indicate a React leak we don't know about.
1403+
1404+
// For host components, disconnect host instance -> fiber pointer.
1405+
if (fiber.tag === HostComponent) {
1406+
const hostInstance: Instance = fiber.stateNode;
1407+
if (hostInstance !== null) {
1408+
detachDeletedInstance(hostInstance);
1409+
}
1410+
}
1411+
14151412
fiber.return = null;
14161413
fiber.dependencies = null;
14171414
fiber.memoizedProps = null;

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.