text: /**
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   *
   * @flow
   */
  
  import {enableCreateEventHandleAPI} from 'shared/ReactFeatureFlags';
  
  export type Flags = number;
  
  // Don't change these two values. They're used by React Dev Tools.
  // 作为 EffectTag 的初始值，或者用于 EffectTag 的比较判断，其值为 0 表示没有副作用，也就是不涉及更新
  export const NoFlags = /*                      */ 0b00000000000000000000000000;
  // 由 React devtools 读取， NoEffect 和 PerformedWork 都不会被 commit，当创建 Effect List时，会跳过NoEffect 和 PerformedWork
  export const PerformedWork = /*                */ 0b00000000000000000000000001;
  
  // You can change the rest (and add more).
  // 表示向树中插入新的子节点，对应的状态为 MOUNTING，当执行 commitPlacement 函数完成插入后， 清除该标志位
  export const Placement = /*                    */ 0b00000000000000000000000010;
  // 表示当 props、state、context 发生变化或者 forceUpdate 时，会标记为 Update ，
  // 检查到标记后，执行 mmitUpdate 函数进行属性更新，与其相关的生命周期函数为 componentDidMount 和 componentDidUpdate
  export const Update = /*                       */ 0b00000000000000000000000100;
  export const PlacementAndUpdate = /*           */ Placement | Update;
  // 标记将要卸载的结点，检查到标记后，执行 commitDeletion 函数对组件进行卸载，
  // 在节点树中删除对应对 节点，与其相关的生命周期函数为 componentWillUnmount
  export const Deletion = /*                     */ 0b00000000000000000000001000;
  export const ChildDeletion = /*                */ 0b00000000000000000000010000;
  export const ContentReset = /*                 */ 0b00000000000000000000100000;
  export const Callback = /*                     */ 0b00000000000000000001000000;
  export const DidCapture = /*                   */ 0b00000000000000000010000000;
  export const ForceClientRender = /*            */ 0b00000000000000000100000000;
  export const Ref = /*                          */ 0b00000000000000001000000000;
  export const Snapshot = /*                     */ 0b00000000000000010000000000;
  export const Passive = /*                      */ 0b00000000000000100000000000;
  export const Hydrating = /*                    */ 0b00000000000001000000000000;
  export const HydratingAndUpdate = /*           */ Hydrating | Update;
  export const Visibility = /*                   */ 0b00000000000010000000000000;
  export const StoreConsistency = /*             */ 0b00000000000100000000000000;
  
  export const LifecycleEffectMask =
    Passive | Update | Callback | Ref | Snapshot | StoreConsistency;
  
  // Union of all commit flags (flags with the lifetime of a particular commit)
  export const HostEffectMask = /*               */ 0b00000000000111111111111111;
  
  // These are not really side effects, but we still reuse this field.
  export const Incomplete = /*                   */ 0b00000000001000000000000000;
  export const ShouldCapture = /*                */ 0b00000000010000000000000000;
  export const ForceUpdateForLegacySuspense = /* */ 0b00000000100000000000000000;
  export const DidPropagateContext = /*          */ 0b00000001000000000000000000;
  export const NeedsPropagation = /*             */ 0b00000010000000000000000000;
  export const Forked = /*                       */ 0b00000100000000000000000000;
  
  // Static tags describe aspects of a fiber that are not specific to a render,
  // e.g. a fiber uses a passive effect (even if there are no updates on this particular render).
  // This enables us to defer more work in the unmount case,
  // since we can defer traversing the tree during layout to look for Passive effects,
  // and instead rely on the static flag as a signal that there may be cleanup work.
  export const RefStatic = /*                    */ 0b00001000000000000000000000;
  export const LayoutStatic = /*                 */ 0b00010000000000000000000000;
  export const PassiveStatic = /*                */ 0b00100000000000000000000000;
  
  // These flags allow us to traverse to fibers that have effects on mount
  // without traversing the entire tree after every commit for
  // double invoking
  export const MountLayoutDev = /*               */ 0b01000000000000000000000000;
  export const MountPassiveDev = /*              */ 0b10000000000000000000000000;
  
  // Groups of flags that are used in the commit phase to skip over trees that
  // don't contain effects, by checking subtreeFlags.
  
  export const BeforeMutationMask =
    // TODO: Remove Update flag from before mutation phase by re-landing Visibility
    // flag logic (see #20043)
    Update |
    Snapshot |
    (enableCreateEventHandleAPI
      ? // createEventHandle needs to visit deleted and hidden trees to
        // fire beforeblur
        // TODO: Only need to visit Deletions during BeforeMutation phase if an
        // element is focused.
      ChildDeletion | Visibility
      : 0);
  
  export const MutationMask =
    Placement |
    Update |
    ChildDeletion |
    ContentReset |
    Ref |
    Hydrating |
    Visibility;
  export const LayoutMask = Update | Callback | Ref | Visibility;
  
  // TODO: Split into PassiveMountMask and PassiveUnmountMask
  export const PassiveMask = Passive | ChildDeletion;
  
  // Union of tags that don't get reset on clones.
  // This allows certain concepts to persist without recalculating them,
  // e.g. whether a subtree contains passive effects or portals.
  export const StaticMask = LayoutStatic | PassiveStatic | RefStatic;
  