diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index a55f39188d0..07b31c52d88 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -342,6 +342,7 @@ public abstract class com/facebook/react/ReactNativeHost { public abstract interface class com/facebook/react/ReactPackage { public abstract fun createNativeModules (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List; public abstract fun createViewManagers (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List; + public fun getModule (Ljava/lang/String;Lcom/facebook/react/bridge/ReactApplicationContext;)Lcom/facebook/react/bridge/NativeModule; } public abstract interface class com/facebook/react/ReactPackageLogger { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackage.java index 940e50c24e1..fd2d2b8e301 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackage.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackage.java @@ -12,7 +12,7 @@ import com.facebook.infer.annotation.Nullsafe; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.common.annotations.DeprecatedInNewArchitecture; -import com.facebook.react.common.annotations.UnstableReactNativeAPI; +import com.facebook.react.common.annotations.StableReactNativeAPI; import com.facebook.react.uimanager.UIManagerModule; import com.facebook.react.uimanager.ViewManager; import java.util.List; @@ -43,7 +43,7 @@ public interface ReactPackage { * is deprecated in the new Architecture of React Native. */ @NonNull - @DeprecatedInNewArchitecture + @DeprecatedInNewArchitecture(message = "Migrate to BaseReactPackage and implement getModule") List createNativeModules(@NonNull ReactApplicationContext reactContext); /** @@ -59,7 +59,7 @@ public interface ReactPackage { * @param reactContext {@link ReactApplicationContext} context for this */ @Nullable - @UnstableReactNativeAPI + @StableReactNativeAPI default NativeModule getModule( @NonNull String name, @NonNull ReactApplicationContext reactContext) { return null;