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 facebook-github-bot committed Mar 19, 2024
1 parent 6084a5b commit d97741a
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 d97741a

Please sign in to comment.