Skip to content

Commit d97741a

Browse files
Support reload in ReactDelegate (#43521)
Summary: Pull Request resolved: #43521 Changelog: [Android] [Added] - Support reload() in ReactDelegate Reviewed By: cortinico Differential Revision: D54967602 fbshipit-source-id: adfa200cabcbecf9507775ac38f17c9d01b2671a
1 parent 6084a5b commit d97741a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ public class com/facebook/react/ReactDelegate {
158158
public fun onKeyLongPress (I)Z
159159
public fun onNewIntent (Landroid/content/Intent;)Z
160160
public fun onWindowFocusChanged (Z)V
161+
public fun reload ()V
161162
public fun shouldShowDevMenuOrReload (ILandroid/view/KeyEvent;)Z
162163
}
163164

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@ public boolean onKeyLongPress(int keyCode) {
225225
return false;
226226
}
227227

228+
public void reload() {
229+
DevSupportManager devSupportManager = getDevSupportManager();
230+
if (devSupportManager != null) {
231+
devSupportManager.handleReloadJS();
232+
}
233+
}
234+
228235
public void loadApp() {
229236
loadApp(mMainComponentName);
230237
}

0 commit comments

Comments
 (0)