Skip to content

Commit 6e1e3df

Browse files
committed
Intentionally clear static flag to test warning
1 parent 5d25752 commit 6e1e3df

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,12 @@ export function createWorkInProgress(current: Fiber, pendingProps: any): Fiber {
289289

290290
// Reset all effects except static ones.
291291
// Static effects are not specific to a render.
292-
workInProgress.flags = current.flags & StaticMask;
292+
// FIXME: I intentionally broke this to confirm that it triggers a warning
293+
// in dev. We should not reset the whole `flags` bitmask; we should preserve
294+
// the static flags.
295+
// workInProgress.flags = current.flags & StaticMask;
296+
workInProgress.flags = NoFlags;
297+
293298
workInProgress.childLanes = current.childLanes;
294299
workInProgress.lanes = current.lanes;
295300

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,12 @@ export function createWorkInProgress(current: Fiber, pendingProps: any): Fiber {
289289

290290
// Reset all effects except static ones.
291291
// Static effects are not specific to a render.
292-
workInProgress.flags = current.flags & StaticMask;
292+
// FIXME: I intentionally broke this to confirm that it triggers a warning
293+
// in dev. We should not reset the whole `flags` bitmask; we should preserve
294+
// the static flags.
295+
// workInProgress.flags = current.flags & StaticMask;
296+
workInProgress.flags = NoFlags;
297+
293298
workInProgress.childLanes = current.childLanes;
294299
workInProgress.lanes = current.lanes;
295300

0 commit comments

Comments
 (0)