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 — Track subtreeFlags et al with bubbleProperties · react/react@b66ae09

File tree

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

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

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiber.new.js
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
enableFundamentalAPI,
2929
enableScopeAPI,
3030
} from 'shared/ReactFeatureFlags';
31-
import {NoFlags, Placement} from './ReactFiberFlags';
31+
import {NoFlags, Placement, StaticMask} from './ReactFiberFlags';
3232
import {ConcurrentRoot, BlockingRoot} from './ReactRootTags';
3333
import {
3434
IndeterminateComponent,
@@ -299,6 +299,9 @@ export function createWorkInProgress(current: Fiber, pendingProps: any): Fiber {
299299
}
300300
}
301301

302+
// Reset all effects except static ones.
303+
// Static effects are not specific to a render.
304+
workInProgress.flags = current.flags & StaticMask;
302305
workInProgress.childLanes = current.childLanes;
303306
workInProgress.lanes = current.lanes;
304307

Collapse file

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

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiber.old.js
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
enableFundamentalAPI,
2929
enableScopeAPI,
3030
} from 'shared/ReactFeatureFlags';
31-
import {NoFlags, Placement} from './ReactFiberFlags';
31+
import {NoFlags, Placement, StaticMask} from './ReactFiberFlags';
3232
import {ConcurrentRoot, BlockingRoot} from './ReactRootTags';
3333
import {
3434
IndeterminateComponent,
@@ -299,6 +299,9 @@ export function createWorkInProgress(current: Fiber, pendingProps: any): Fiber {
299299
}
300300
}
301301

302+
// Reset all effects except static ones.
303+
// Static effects are not specific to a render.
304+
workInProgress.flags = current.flags & StaticMask;
302305
workInProgress.childLanes = current.childLanes;
303306
workInProgress.lanes = current.lanes;
304307

Collapse file

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

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberBeginWork.new.js
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import {
6363
Deletion,
6464
ChildDeletion,
6565
ForceUpdateForLegacySuspense,
66+
StaticMask,
6667
} from './ReactFiberFlags';
6768
import ReactSharedInternals from 'shared/ReactSharedInternals';
6869
import {
@@ -2092,6 +2093,12 @@ function updateSuspenseFallbackChildren(
20922093
currentPrimaryChildFragment,
20932094
primaryChildProps,
20942095
);
2096+
2097+
// Since we're reusing a current tree, we need to reuse the flags, too.
2098+
// (We don't do this in legacy mode, because in legacy mode we don't re-use
2099+
// the current tree; see previous branch.)
2100+
primaryChildFragment.subtreeFlags =
2101+
currentPrimaryChildFragment.subtreeFlags & StaticMask;
20952102
}
20962103
let fallbackChildFragment;
20972104
if (currentFallbackChildFragment !== null) {
Collapse file

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

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberBeginWork.old.js
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import {
6363
Deletion,
6464
ChildDeletion,
6565
ForceUpdateForLegacySuspense,
66+
StaticMask,
6667
} from './ReactFiberFlags';
6768
import ReactSharedInternals from 'shared/ReactSharedInternals';
6869
import {
@@ -2092,6 +2093,12 @@ function updateSuspenseFallbackChildren(
20922093
currentPrimaryChildFragment,
20932094
primaryChildProps,
20942095
);
2096+
2097+
// Since we're reusing a current tree, we need to reuse the flags, too.
2098+
// (We don't do this in legacy mode, because in legacy mode we don't re-use
2099+
// the current tree; see previous branch.)
2100+
primaryChildFragment.subtreeFlags =
2101+
currentPrimaryChildFragment.subtreeFlags & StaticMask;
20952102
}
20962103
let fallbackChildFragment;
20972104
if (currentFallbackChildFragment !== 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.