Skip to content

Commit

Permalink
Replace DevInternalSettings with DeveloperSettings
Browse files Browse the repository at this point in the history
DevInternalSettings was enclosed in ReactNative 0.73.0-rc.2, so we need to replace it with public class DeveloperSettings.
facebook/react-native#37256
  • Loading branch information
DmitriyKirakosyan committed Nov 9, 2023
1 parent 64bcdba commit af7b9ab
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.devsupport.DevInternalSettings;
import com.facebook.react.devsupport.interfaces.DevSupportManager;
import com.facebook.react.modules.debug.interfaces.DeveloperSettings;
import com.facebook.react.uimanager.ViewManager;

import org.json.JSONException;
Expand Down Expand Up @@ -152,12 +152,12 @@ private boolean isLiveReloadEnabled(ReactInstanceManager instanceManager) {
if (instanceManager != null) {
DevSupportManager devSupportManager = instanceManager.getDevSupportManager();
if (devSupportManager != null) {
DevInternalSettings devInternalSettings = (DevInternalSettings)devSupportManager.getDevSettings();
Method[] methods = devInternalSettings.getClass().getMethods();
DeveloperSettings devSettings = devSupportManager.getDevSettings();
Method[] methods = devSettings.getClass().getMethods();
for (Method m : methods) {
if (m.getName().equals("isReloadOnJSChangeEnabled")) {
try {
return (boolean) m.invoke(devInternalSettings);
return (boolean) m.invoke(devSettings);
} catch (Exception x) {
return false;
}
Expand Down

0 comments on commit af7b9ab

Please sign in to comment.