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 — [react-core] Clear more properties in detachFiber (#16807) · react/react@2f1e8c5

File tree

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

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

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberCommitWork.js
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,7 @@ function commitNestedUnmounts(
893893
}
894894

895895
function detachFiber(current: Fiber) {
896+
const alternate = current.alternate;
896897
// Cut off the return pointers to disconnect it from the tree. Ideally, we
897898
// should clear the child pointer of the parent alternate to let this
898899
// get GC:ed but we don't know which for sure which parent is the current
@@ -903,13 +904,14 @@ function detachFiber(current: Fiber) {
903904
current.memoizedState = null;
904905
current.updateQueue = null;
905906
current.dependencies = null;
906-
const alternate = current.alternate;
907+
current.sibling = null;
908+
current.alternate = null;
909+
current.firstEffect = null;
910+
current.lastEffect = null;
911+
current.pendingProps = null;
912+
current.memoizedProps = null;
907913
if (alternate !== null) {
908-
alternate.return = null;
909-
alternate.child = null;
910-
alternate.memoizedState = null;
911-
alternate.updateQueue = null;
912-
alternate.dependencies = null;
914+
detachFiber(alternate);
913915
}
914916
}
915917

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.