Skip to content

Commit

Permalink
React-Native-Restart in release (#43645)
Browse files Browse the repository at this point in the history
Summary:

#43521 & #43588 aimed to fix `react-native-restart`, however in release `handleReloadJS()` is a no-op in [DisabledDevSupportManager](https://github.com/facebook/react-native/blob/ac714b1c3300d3a169bdcfec05d556e18a7b83ff/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DisabledDevSupportManager.java#L139) which is why this should not work. Fixing it by relying on `ReactHostImpl.reload()` instead for Bridgeless.

Differential Revision: D55342296
  • Loading branch information
arushikesarwani94 authored and facebook-github-bot committed Mar 26, 2024
1 parent 00725fa commit 119831a
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,16 @@ public boolean onKeyLongPress(int keyCode) {
}

public void reload() {
DevSupportManager devSupportManager = getDevSupportManager();
if (devSupportManager != null) {
devSupportManager.handleReloadJS();
if (ReactFeatureFlags.enableBridgelessArchitecture && mReactHost != null) {
mReactHost.reload("ReactDelegate.reload()");
} else {
if (getReactNativeHost().hasInstance() && getReactNativeHost().getUseDeveloperSupport()) {
DevSupportManager devSupportManager =
getReactNativeHost().getReactInstanceManager().getDevSupportManager();
if (devSupportManager != null) {
devSupportManager.handleReloadJS();
}
}
}
}

Expand Down

0 comments on commit 119831a

Please sign in to comment.