Skip to content

Commit 2743fb7

Browse files
authored
Enable hooks by default for FB React Native renderer (#14435)
* Enable hooks by default for FB React Native renderer * Updated RN+FB feature flags to make some of the dynamic ones static
1 parent 7325ebe commit 2743fb7

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

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

+6-8
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,21 @@ import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
1313
import typeof * as FeatureFlagsShimType from './ReactFeatureFlags.native-fb';
1414

1515
// Re-export dynamic flags from the fbsource version.
16-
export const {
17-
enableHooks,
18-
debugRenderPhaseSideEffects,
19-
debugRenderPhaseSideEffectsForStrictMode,
20-
warnAboutDeprecatedLifecycles,
21-
replayFailedUnitOfWorkWithInvokeGuardedCallback,
22-
disableInputAttributeSyncing,
23-
} = require('ReactFeatureFlags');
16+
export const {debugRenderPhaseSideEffects} = require('ReactFeatureFlags');
2417

2518
// The rest of the flags are static for better dead code elimination.
19+
export const enableHooks = true;
2620
export const enableUserTimingAPI = __DEV__;
2721
export const enableProfilerTimer = __PROFILE__;
2822
export const enableSchedulerTracing = __PROFILE__;
2923
export const enableSuspenseServerRenderer = false;
3024
export const enableStableConcurrentModeAPIs = false;
3125
export const warnAboutShorthandPropertyCollision = false;
3226
export const enableSchedulerDebugging = false;
27+
export const debugRenderPhaseSideEffectsForStrictMode = true;
28+
export const disableInputAttributeSyncing = false;
29+
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
30+
export const warnAboutDeprecatedLifecycles = true;
3331

3432
// Only used in www builds.
3533
export function addUserTimingListener() {

scripts/rollup/shims/react-native-fb/ReactFeatureFlags.js

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
const ReactFeatureFlags = {
1414
debugRenderPhaseSideEffects: false,
15-
debugRenderPhaseSideEffectsForStrictMode: false,
16-
warnAboutDeprecatedLifecycles: true,
1715
};
1816

1917
module.exports = ReactFeatureFlags;

0 commit comments

Comments
 (0)