@samitouri / QOS-React-1 / commits / 3b009b4cd5

Make RefStatic and LayoutStatic the same bit (#31965)

Refs are basically just fancy Layout Effects. These are conceptually the same thing and are always visited together so they don't need to be different flags. Whenever we disappear/reappear Offscreen content we need to do both Refs and Layout Effects. This is just indicating which phase needs to be visited and these are always the same phase.

Sebastian Markbåge committed Jan 2, 2025 at 21:23 UTC 3b009b4cd58d382cfde2a72232c87df1a34d56d5
1 file changed +1 -1
packages/react-reconciler/src/ReactFiberFlags.js
+1 -1
@@ -66,8 +66,8 @@ export const Forked = /* */ 0b0000000100000000000000000000
66 // This enables us to defer more work in the unmount case,
67 // since we can defer traversing the tree during layout to look for Passive effects,
68 // and instead rely on the static flag as a signal that there may be cleanup work.
69 -export const RefStatic = /* */ 0b0000001000000000000000000000;
69 export const LayoutStatic = /* */ 0b0000010000000000000000000000;
70 +export const RefStatic = LayoutStatic;
71 export const PassiveStatic = /* */ 0b0000100000000000000000000000;
72 export const MaySuspendCommit = /* */ 0b0001000000000000000000000000;
73