From 2743fb7b23a5af42059a9b07c5f6048f941709d9 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Thu, 13 Dec 2018 13:20:23 -0800 Subject: [PATCH] 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 --- .../shared/forks/ReactFeatureFlags.native-fb.js | 14 ++++++-------- .../shims/react-native-fb/ReactFeatureFlags.js | 2 -- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/shared/forks/ReactFeatureFlags.native-fb.js b/packages/shared/forks/ReactFeatureFlags.native-fb.js index 7e6332cf67490..943cef96e8a51 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-fb.js +++ b/packages/shared/forks/ReactFeatureFlags.native-fb.js @@ -13,16 +13,10 @@ import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags'; import typeof * as FeatureFlagsShimType from './ReactFeatureFlags.native-fb'; // Re-export dynamic flags from the fbsource version. -export const { - enableHooks, - debugRenderPhaseSideEffects, - debugRenderPhaseSideEffectsForStrictMode, - warnAboutDeprecatedLifecycles, - replayFailedUnitOfWorkWithInvokeGuardedCallback, - disableInputAttributeSyncing, -} = require('ReactFeatureFlags'); +export const {debugRenderPhaseSideEffects} = require('ReactFeatureFlags'); // The rest of the flags are static for better dead code elimination. +export const enableHooks = true; export const enableUserTimingAPI = __DEV__; export const enableProfilerTimer = __PROFILE__; export const enableSchedulerTracing = __PROFILE__; @@ -30,6 +24,10 @@ export const enableSuspenseServerRenderer = false; export const enableStableConcurrentModeAPIs = false; export const warnAboutShorthandPropertyCollision = false; export const enableSchedulerDebugging = false; +export const debugRenderPhaseSideEffectsForStrictMode = true; +export const disableInputAttributeSyncing = false; +export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__; +export const warnAboutDeprecatedLifecycles = true; // Only used in www builds. export function addUserTimingListener() { diff --git a/scripts/rollup/shims/react-native-fb/ReactFeatureFlags.js b/scripts/rollup/shims/react-native-fb/ReactFeatureFlags.js index 55ef3d80b1964..86feb9c022821 100644 --- a/scripts/rollup/shims/react-native-fb/ReactFeatureFlags.js +++ b/scripts/rollup/shims/react-native-fb/ReactFeatureFlags.js @@ -12,8 +12,6 @@ const ReactFeatureFlags = { debugRenderPhaseSideEffects: false, - debugRenderPhaseSideEffectsForStrictMode: false, - warnAboutDeprecatedLifecycles: true, }; module.exports = ReactFeatureFlags;