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 — Check for deletions in `hadNoMutationsEffects` (#20252) · react/react@b44e4b1

File tree

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

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

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberCompleteWork.new.js
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,18 @@ function hadNoMutationsEffects(current: null | Fiber, completedWork: Fiber) {
178178
return true;
179179
}
180180

181+
if ((completedWork.flags & Deletion) !== NoFlags) {
182+
return false;
183+
}
184+
185+
// TODO: If we move the `hadNoMutationsEffects` call after `bubbleProperties`
186+
// then we only have to check the `completedWork.subtreeFlags`.
181187
let child = completedWork.child;
182188
while (child !== null) {
183-
if ((child.flags & MutationMask) !== NoFlags) {
189+
if ((child.flags & (MutationMask | Deletion)) !== NoFlags) {
184190
return false;
185191
}
186-
if ((child.subtreeFlags & MutationMask) !== NoFlags) {
192+
if ((child.subtreeFlags & (MutationMask | Deletion)) !== NoFlags) {
187193
return false;
188194
}
189195
child = child.sibling;

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.