From 17f8e5810f3260ce1b24c61665883bab8847aabe Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 24 Jul 2019 13:05:19 -0700 Subject: [PATCH] Enable by default Summary: This enables Fast Refresh by default. More concretely: * For clean installs, it's enabled by default. (You can opt out at any time via the dev menu.) * For updated DEV apps (on device or simulator), it flips from disabled to enabled **but only if you never touched the setting before**. * If you previously explicitly enabled and/or later disabled it, we keep your previous setting. Reviewed By: yungsters Differential Revision: D16442656 fbshipit-source-id: 1bfe0bf4bcf2830284f9c757fbfacc10db92acb4 --- React/Modules/RCTDevSettings.mm | 1 + .../java/com/facebook/react/devsupport/DevInternalSettings.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/React/Modules/RCTDevSettings.mm b/React/Modules/RCTDevSettings.mm index 2498053b0f39a9..be2348cac8e87c 100644 --- a/React/Modules/RCTDevSettings.mm +++ b/React/Modules/RCTDevSettings.mm @@ -131,6 +131,7 @@ - (instancetype)init // default behavior is to use NSUserDefaults NSDictionary *defaultValues = @{ kRCTDevSettingShakeToShowDevMenu: @YES, + kRCTDevSettingHotLoadingEnabled: @YES, }; RCTDevSettingsUserDefaultsDataSource *dataSource = [[RCTDevSettingsUserDefaultsDataSource alloc] initWithDefaultValues:defaultValues]; return [self initWithDataSource:dataSource]; diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevInternalSettings.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevInternalSettings.java index a653763be6d3c4..59b9837e5734dd 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevInternalSettings.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevInternalSettings.java @@ -107,7 +107,7 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin } public boolean isHotModuleReplacementEnabled() { - return mPreferences.getBoolean(PREFS_HOT_MODULE_REPLACEMENT_KEY, false); + return mPreferences.getBoolean(PREFS_HOT_MODULE_REPLACEMENT_KEY, true); } public void setHotModuleReplacementEnabled(boolean enabled) {