Several EffectTag

export const NoFlags = /*                      */ 0b0000000000000000000;
export const PerformedWork = /*                */ 0b0000000000000000001;

export const Placement = /*                    */ 0b0000000000000000010;
export const Update = /*                       */ 0b0000000000000000100;
export const PlacementAndUpdate = /*           */ 0b0000000000000000110;
export const Deletion = /*                     */ 0b0000000000000001000;
export const ContentReset = /*                 */ 0b0000000000000010000;
export const Callback = /*                     */ 0b0000000000000100000;
export const DidCapture = /*                   */ 0b0000000000001000000;
export const Ref = /*                          */ 0b0000000000010000000;
export const Snapshot = /*                     */ 0b0000000000100000000;
export const Passive = /*                      */ 0b0000000001000000000;
export const Hydrating = /*                    */ 0b0000000010000000000;
export const HydratingAndUpdate = /*           */ 0b0000000010000000100;
export const Visibility = /*                   */ 0b0000000100000000000;
Copy the code

Why binary?

Consider a case where a DOM node corresponding to a Fiber node first inserts the page and then updates the properties, which can be easily done using bitwise or operations

    let flag = NoFlags
    flag |= Placement
    flag |= Update
    // ...
    
    flag === PlacementAndUpdate // true
Copy the code

The commitMutationEffects method uses effectTags in the source code

const primaryFlags = flags & (Placement | Update | Deletion | Hydrating);
    switch (primaryFlags) {
      case Placement: ...
      case PlacementAndUpdate: ...
      case Hydrating: ...
      case HydratingAndUpdate: ...
      case Update: ...
      case Deletion: ...
    }
Copy the code

(Placement | Update | Deletion | Hydrating) several tags get binary 0 b0000010000001110 the bitwise or operator, contains all of the switch, and can cause mutations in several cases have been included