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 — Set return pointer when reusing current tree (#20212) · react/react@c896cf9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-reconciler/src
    • ReactFiberCommitWork.new.js
    • ReactFiberCompleteWork.new.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
-14Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ function iterativelyCommitBeforeMutationEffects_begin() {
463463
(fiber.subtreeFlags & BeforeMutationMask) !== NoFlags &&
464464
child !== null
465465
) {
466-
child.return = fiber;
467466
nextEffect = child;
468467
} else {
469468
iterativelyCommitBeforeMutationEffects_complete();
@@ -497,7 +496,6 @@ function iterativelyCommitBeforeMutationEffects_complete() {
497496

498497
const sibling = fiber.sibling;
499498
if (sibling !== null) {
500-
sibling.return = fiber.return;
501499
nextEffect = sibling;
502500
return;
503501
}
@@ -715,7 +713,6 @@ function iterativelyCommitMutationEffects_begin(
715713

716714
const child = fiber.child;
717715
if ((fiber.subtreeFlags & MutationMask) !== NoFlags && child !== null) {
718-
child.return = fiber;
719716
nextEffect = child;
720717
} else {
721718
iterativelyCommitMutationEffects_complete(root, renderPriorityLevel);
@@ -754,7 +751,6 @@ function iterativelyCommitMutationEffects_complete(
754751

755752
const sibling = fiber.sibling;
756753
if (sibling !== null) {
757-
sibling.return = fiber.return;
758754
nextEffect = sibling;
759755
return;
760756
}
@@ -1176,14 +1172,12 @@ function iterativelyCommitLayoutEffects_begin(
11761172
}
11771173
const sibling = finishedWork.sibling;
11781174
if (sibling !== null) {
1179-
sibling.return = finishedWork.return;
11801175
nextEffect = sibling;
11811176
} else {
11821177
nextEffect = finishedWork.return;
11831178
iterativelyCommitLayoutEffects_complete(subtreeRoot, finishedRoot);
11841179
}
11851180
} else {
1186-
firstChild.return = finishedWork;
11871181
nextEffect = firstChild;
11881182
}
11891183
} else {
@@ -1230,7 +1224,6 @@ function iterativelyCommitLayoutEffects_complete(
12301224

12311225
const sibling = fiber.sibling;
12321226
if (sibling !== null) {
1233-
sibling.return = fiber.return;
12341227
nextEffect = sibling;
12351228
return;
12361229
}
@@ -1764,14 +1757,12 @@ function iterativelyCommitPassiveMountEffects_begin(
17641757
}
17651758
const sibling = fiber.sibling;
17661759
if (sibling !== null) {
1767-
sibling.return = fiber.return;
17681760
nextEffect = sibling;
17691761
} else {
17701762
nextEffect = fiber.return;
17711763
iterativelyCommitPassiveMountEffects_complete(subtreeRoot, root);
17721764
}
17731765
} else {
1774-
firstChild.return = fiber;
17751766
nextEffect = firstChild;
17761767
}
17771768
} else {
@@ -1817,7 +1808,6 @@ function iterativelyCommitPassiveMountEffects_complete(
18171808

18181809
const sibling = fiber.sibling;
18191810
if (sibling !== null) {
1820-
sibling.return = fiber.return;
18211811
nextEffect = sibling;
18221812
return;
18231813
}
@@ -1896,7 +1886,6 @@ function iterativelyCommitPassiveUnmountEffects_begin() {
18961886
}
18971887

18981888
if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) {
1899-
child.return = fiber;
19001889
nextEffect = child;
19011890
} else {
19021891
iterativelyCommitPassiveUnmountEffects_complete();
@@ -1915,7 +1904,6 @@ function iterativelyCommitPassiveUnmountEffects_complete() {
19151904

19161905
const sibling = fiber.sibling;
19171906
if (sibling !== null) {
1918-
sibling.return = fiber.return;
19191907
nextEffect = sibling;
19201908
return;
19211909
}
@@ -1953,7 +1941,6 @@ function iterativelyCommitPassiveUnmountEffectsInsideOfDeletedTree_begin(
19531941
const fiber = nextEffect;
19541942
const child = fiber.child;
19551943
if ((fiber.subtreeFlags & PassiveStatic) !== NoFlags && child !== null) {
1956-
child.return = fiber;
19571944
nextEffect = child;
19581945
} else {
19591946
iterativelyCommitPassiveUnmountEffectsInsideOfDeletedTree_complete(
@@ -1981,7 +1968,6 @@ function iterativelyCommitPassiveUnmountEffectsInsideOfDeletedTree_complete(
19811968

19821969
const sibling = fiber.sibling;
19831970
if (sibling !== null) {
1984-
sibling.return = fiber.return;
19851971
nextEffect = sibling;
19861972
return;
19871973
}
Collapse file

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

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberCompleteWork.new.js
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,11 @@ function bubbleProperties(completedWork: Fiber) {
738738
subtreeFlags |= child.subtreeFlags;
739739
subtreeFlags |= child.flags;
740740

741+
// Update the return pointer so the tree is consistent. This is a code
742+
// smell because it assumes the commit phase is never concurrent with
743+
// the render phase. Will address during refactor to alternate model.
744+
child.return = completedWork;
745+
741746
child = child.sibling;
742747
}
743748
}
@@ -784,6 +789,11 @@ function bubbleProperties(completedWork: Fiber) {
784789
subtreeFlags |= child.subtreeFlags & StaticMask;
785790
subtreeFlags |= child.flags & StaticMask;
786791

792+
// Update the return pointer so the tree is consistent. This is a code
793+
// smell because it assumes the commit phase is never concurrent with
794+
// the render phase. Will address during refactor to alternate model.
795+
child.return = completedWork;
796+
787797
child = child.sibling;
788798
}
789799
}

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.