Skip to content

Commit ca95570

Browse files
committed
Gate Update flag on BeforeMutationMask on flags
1 parent 97d7949 commit ca95570

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

packages/react-reconciler/src/ReactFiberFlags.js

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

10-
import {enableCreateEventHandleAPI} from 'shared/ReactFeatureFlags';
10+
import {
11+
enableCreateEventHandleAPI,
12+
enableUseEffectEventHook,
13+
} from 'shared/ReactFeatureFlags';
1114

1215
export type Flags = number;
1316

@@ -77,17 +80,19 @@ export const MountPassiveDev = /* */ 0b1000000000000000000000000000
7780
// don't contain effects, by checking subtreeFlags.
7881

7982
export const BeforeMutationMask: number =
80-
// TODO: Remove Update flag from before mutation phase by re-landing Visibility
81-
// flag logic (see #20043)
82-
Update |
8383
Snapshot |
8484
(enableCreateEventHandleAPI
8585
? // createEventHandle needs to visit deleted and hidden trees to
8686
// fire beforeblur
8787
// TODO: Only need to visit Deletions during BeforeMutation phase if an
8888
// element is focused.
89-
ChildDeletion | Visibility
90-
: 0);
89+
Update | ChildDeletion | Visibility
90+
: enableUseEffectEventHook
91+
? // TODO: The useEffectEvent hook uses the snapshot phase for clean up but it
92+
// really should use the mutation phase for this or at least schedule an
93+
// explicit Snapshot phase flag for this.
94+
Update
95+
: 0);
9196

9297
export const MutationMask =
9398
Placement |

0 commit comments

Comments
 (0)