From 7a841dbcd1b4eead77827eda2bd307f11babec1f Mon Sep 17 00:00:00 2001 From: Arushi Kesarwani Date: Wed, 24 Apr 2024 00:20:54 -0700 Subject: [PATCH] Fixing exposing ReactDelegate through ReactActivity for reload() (#44227) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44227 In https://github.com/facebook/react-native/pull/44223/ kudo identified the incorrect return type. Reviewed By: christophpurrer, philIip Differential Revision: D56497700 fbshipit-source-id: 5d7fc7ef21c3d3033a2567eba51b613eb41f0a1a --- packages/react-native/ReactAndroid/api/ReactAndroid.api | 3 +-- .../src/main/java/com/facebook/react/ReactActivity.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index 04b156b38a5442..0f8294bec0637a 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -92,7 +92,7 @@ public abstract class com/facebook/react/ReactActivity : androidx/appcompat/app/ protected fun ()V protected fun createReactActivityDelegate ()Lcom/facebook/react/ReactActivityDelegate; protected fun getMainComponentName ()Ljava/lang/String; - public fun getReactDelegate ()V + public fun getReactDelegate ()Lcom/facebook/react/ReactDelegate; protected final fun getReactInstanceManager ()Lcom/facebook/react/ReactInstanceManager; protected final fun getReactNativeHost ()Lcom/facebook/react/ReactNativeHost; public fun invokeDefaultOnBackPressed ()V @@ -7697,4 +7697,3 @@ public class com/facebook/react/views/view/ViewGroupClickEvent : com/facebook/re protected fun getEventData ()Lcom/facebook/react/bridge/WritableMap; public fun getEventName ()Ljava/lang/String; } - diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java index ef827a4f16a165..95862974324623 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java @@ -65,8 +65,8 @@ protected void onDestroy() { mDelegate.onDestroy(); } - public void getReactDelegate() { - mDelegate.getReactDelegate(); + public @Nullable ReactDelegate getReactDelegate() { + return mDelegate.getReactDelegate(); } @Override