GeezerVison is showing github.com — Add PassiveStatic to trees with passive effects · react/react@19e15a3
File treeExpand file treeCollapse file tree Open diff view settings packages/react-reconciler/src
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberHooks.new.js +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -49,6 +49,7 @@ import {readContext} from './ReactFiberNewContext.new'; | 49 | 49 | import { | 50 | 50 | Update as UpdateEffect, | 51 | 51 | Passive as PassiveEffect, | | 52 | + PassiveStatic as PassiveStaticEffect, | 52 | 53 | } from './ReactFiberFlags'; | 53 | 54 | import { | 54 | 55 | HasEffect as HookHasEffect, | @@ -1304,7 +1305,7 @@ function mountEffect( | 1304 | 1305 | } | 1305 | 1306 | } | 1306 | 1307 | return mountEffectImpl( | 1307 | | - UpdateEffect | PassiveEffect, | | 1308 | + UpdateEffect | PassiveEffect | PassiveStaticEffect, | 1308 | 1309 | HookPassive, | 1309 | 1310 | create, | 1310 | 1311 | deps, | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberHooks.old.js +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -49,6 +49,7 @@ import {readContext} from './ReactFiberNewContext.old'; | 49 | 49 | import { | 50 | 50 | Update as UpdateEffect, | 51 | 51 | Passive as PassiveEffect, | | 52 | + PassiveStatic as PassiveStaticEffect, | 52 | 53 | } from './ReactFiberFlags'; | 53 | 54 | import { | 54 | 55 | HasEffect as HookHasEffect, | @@ -1304,7 +1305,7 @@ function mountEffect( | 1304 | 1305 | } | 1305 | 1306 | } | 1306 | 1307 | return mountEffectImpl( | 1307 | | - UpdateEffect | PassiveEffect, | | 1308 | + UpdateEffect | PassiveEffect | PassiveStaticEffect, | 1308 | 1309 | HookPassive, | 1309 | 1310 | create, | 1310 | 1311 | deps, | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberWorkLoop.new.js +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -132,6 +132,7 @@ import { | 132 | 132 | HostEffectMask, | 133 | 133 | Hydrating, | 134 | 134 | HydratingAndUpdate, | | 135 | + StaticMask, | 135 | 136 | } from './ReactFiberFlags'; | 136 | 137 | import { | 137 | 138 | NoLanePriority, | @@ -1781,7 +1782,7 @@ function completeUnitOfWork(unitOfWork: Fiber): void { | 1781 | 1782 | // Skip both NoWork and PerformedWork tags when creating the effect | 1782 | 1783 | // list. PerformedWork effect is read by React DevTools but shouldn't be | 1783 | 1784 | // committed. | 1784 | | - if (flags > PerformedWork) { | | 1785 | + if ((flags & ~StaticMask) > PerformedWork) { | 1785 | 1786 | if (returnFiber.lastEffect !== null) { | 1786 | 1787 | returnFiber.lastEffect.nextEffect = completedWork; | 1787 | 1788 | } else { | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberWorkLoop.old.js +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -132,6 +132,7 @@ import { | 132 | 132 | HostEffectMask, | 133 | 133 | Hydrating, | 134 | 134 | HydratingAndUpdate, | | 135 | + StaticMask, | 135 | 136 | } from './ReactFiberFlags'; | 136 | 137 | import { | 137 | 138 | NoLanePriority, | @@ -1781,7 +1782,7 @@ function completeUnitOfWork(unitOfWork: Fiber): void { | 1781 | 1782 | // Skip both NoWork and PerformedWork tags when creating the effect | 1782 | 1783 | // list. PerformedWork effect is read by React DevTools but shouldn't be | 1783 | 1784 | // committed. | 1784 | | - if (flags > PerformedWork) { | | 1785 | + if ((flags & ~StaticMask) > PerformedWork) { | 1785 | 1786 | if (returnFiber.lastEffect !== null) { | 1786 | 1787 | returnFiber.lastEffect.nextEffect = completedWork; | 1787 | 1788 | } else { | |
|