Skip to content

Commit e793c9d

Browse files
committed
Gate behind createEventHandle feature flag
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.
1 parent e8e42f5 commit e793c9d

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

packages/react-reconciler/src/ReactFiberFlags.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* @flow
88
*/
99

10+
import {enableCreateEventHandleAPI} from 'shared/ReactFeatureFlags';
11+
1012
export type Flags = number;
1113

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

5153
// Union of side effect groupings as pertains to subtreeFlags
52-
// TODO: Only need to visit Deletions during BeforeMutation phase if an element
53-
// is focused.
54-
export const BeforeMutationMask = /* */ 0b0000000100100001000;
54+
55+
export const BeforeMutationMask =
56+
Snapshot |
57+
(enableCreateEventHandleAPI
58+
? // createEventHandle needs to visit deleted and hidden trees to
59+
// fire beforeblur
60+
// TODO: Only need to visit Deletions during BeforeMutation phase if an
61+
// element is focused.
62+
Deletion | Visibility
63+
: 0);
64+
5565
export const MutationMask = /* */ 0b0000000110010011110;
5666
export const LayoutMask = /* */ 0b0000000000010100100;
5767
export const PassiveMask = /* */ 0b0000000001000001000;

0 commit comments

Comments
 (0)