Skip to content

Commit ea5bc6b

Browse files
authored
[React Native FB] dynamic feature flag for ref access warning (#25471)
1 parent fd31724 commit ea5bc6b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js

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

10-
// NOTE: There are no flags, currently. Uncomment the stuff below if we add one.
11-
12-
// import typeof * as ExportsType from './ReactFeatureFlags.native-fb-dynamic';
13-
// import typeof * as DynamicFlagsType from 'ReactNativeInternalFeatureFlags';
10+
import typeof * as ExportsType from './ReactFeatureFlags.native-fb-dynamic';
11+
import typeof * as DynamicFlagsType from 'ReactNativeInternalFeatureFlags';
1412

1513
// In xplat, these flags are controlled by GKs. Because most GKs have some
1614
// population running in either mode, we should run our tests that way, too,
@@ -22,5 +20,7 @@
2220
// flag here but it won't be set to `true` in any of our test runs. Need to
2321
// update the test configuration.
2422

25-
// // Flow magic to verify the exports of this file match the original version.
26-
// ((((null: any): ExportsType): FeatureFlagsType): ExportsType);
23+
export const enableUseRefAccessWarning = __VARIANT__;
24+
25+
// Flow magic to verify the exports of this file match the original version.
26+
((((null: any): ExportsType): DynamicFlagsType): ExportsType);

packages/shared/forks/ReactFeatureFlags.native-fb.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import typeof * as ExportsType from './ReactFeatureFlags.native-fb';
1313
// NOTE: There are no flags, currently. Uncomment the stuff below if we add one.
1414
// Re-export dynamic flags from the internal module. Intentionally using *
1515
// because this import is compiled to a `require` call.
16-
// import * as dynamicFlags from 'ReactNativeInternalFeatureFlags';
16+
import * as dynamicFlags from 'ReactNativeInternalFeatureFlags';
1717

1818
// We destructure each value before re-exporting to avoid a dynamic look-up on
1919
// the exports object every time a flag is read.
20-
// export const {} = dynamicFlags;
20+
export const {enableUseRefAccessWarning} = dynamicFlags;
2121

2222
// The rest of the flags are static for better dead code elimination.
2323
export const enableDebugTracing = false;
@@ -67,7 +67,6 @@ export const deferRenderPhaseUpdateToNextBatch = false;
6767

6868
export const enableStrictEffects = __DEV__;
6969
export const createRootStrictEffectsByDefault = false;
70-
export const enableUseRefAccessWarning = false;
7170

7271
export const disableSchedulerTimeoutInWorkLoop = false;
7372
export const enableLazyContextPropagation = false;

scripts/flow/xplat.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
*/
99

1010
declare module 'ReactNativeInternalFeatureFlags' {
11+
declare export var enableUseRefAccessWarning: boolean;
1112
}

0 commit comments

Comments
 (0)