Skip to content

Commit

Permalink
Gate behind createEventHandle feature flag
Browse files Browse the repository at this point in the history
Only need to visit deleted and hidden trees during the snapshot phase
if the experimental `createEventHandle` flag is enabled. Currently,
it's only used internally at Facebook, not open source.
  • Loading branch information
acdlite committed Oct 16, 2020
1 parent e8e42f5 commit e793c9d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/react-reconciler/src/ReactFiberFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* @flow
*/

import {enableCreateEventHandleAPI} from 'shared/ReactFeatureFlags';

export type Flags = number;

// Don't change these two values. They're used by React Dev Tools.
Expand Down Expand Up @@ -49,9 +51,17 @@ export const ForceUpdateForLegacySuspense = /* */ 0b0001000000000000000;
export const PassiveStatic = /* */ 0b0010000000000000000;

// Union of side effect groupings as pertains to subtreeFlags
// TODO: Only need to visit Deletions during BeforeMutation phase if an element
// is focused.
export const BeforeMutationMask = /* */ 0b0000000100100001000;

export const BeforeMutationMask =
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.
Deletion | Visibility
: 0);

export const MutationMask = /* */ 0b0000000110010011110;
export const LayoutMask = /* */ 0b0000000000010100100;
export const PassiveMask = /* */ 0b0000000001000001000;
Expand Down

0 comments on commit e793c9d

Please sign in to comment.