Skip to content

Commit

Permalink
Support reload in ReactDelegate (#43521)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #43521

Changelog:
[Android] [Added] - Support reload() in ReactDelegate

Reviewed By: cortinico

Differential Revision: D54967602

fbshipit-source-id: adfa200cabcbecf9507775ac38f17c9d01b2671a
  • Loading branch information
arushikesarwani94 authored and cortinico committed Mar 25, 2024
1 parent 36d6431 commit 0e5ba6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public class com/facebook/react/ReactDelegate {
public fun onKeyLongPress (I)Z
public fun onNewIntent (Landroid/content/Intent;)Z
public fun onWindowFocusChanged (Z)V
public fun reload ()V
public fun shouldShowDevMenuOrReload (ILandroid/view/KeyEvent;)Z
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,13 @@ public boolean onKeyLongPress(int keyCode) {
return false;
}

public void reload() {
DevSupportManager devSupportManager = getDevSupportManager();
if (devSupportManager != null) {
devSupportManager.handleReloadJS();
}
}

public void loadApp() {
loadApp(mMainComponentName);
}
Expand Down

0 comments on commit 0e5ba6d

Please sign in to comment.