Skip to content

Commit

Permalink
Support reload in ReactDelegate
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[Android] [Added] - Support reload() in ReactDelegate

Differential Revision: D54967602
  • Loading branch information
arushikesarwani94 authored and facebook-github-bot committed Mar 16, 2024
1 parent ff7d00a commit 1ce27bc
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 @@ -158,6 +158,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 @@ -225,6 +225,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 1ce27bc

Please sign in to comment.