From 03fd31d8393e5e11538f6a689e83c33cbf633db4 Mon Sep 17 00:00:00 2001 From: David Vacca <515103+mdvacca@users.noreply.github.com> Date: Fri, 8 Sep 2023 08:57:15 -0700 Subject: [PATCH] Deprecate ReactPackage.createNativeModules recommending using getModule instead (#39339) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39339 Deprecating createNativeModules method from ReactPackage interface recommending using getModule instead in the new architecture of React Native changelog: [Android][Changed] Deprecating createNativeModules method from ReactPackage interface recommending using getModule instead in the new architecture of React Native Reviewed By: cortinico Differential Revision: D48992719 fbshipit-source-id: ba8aebcd9d737daae6a8023210d424a7f142afae --- .../src/main/java/com/facebook/react/ReactPackage.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 f09953e633ed4d..a579354f218cd4 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 @@ -11,6 +11,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.uimanager.UIManagerModule; import com.facebook.react.uimanager.ViewManager; import java.util.List; @@ -37,9 +38,11 @@ public interface ReactPackage { /** * @param reactContext react application context that can be used to create modules - * @return list of native modules to register with the newly created catalyst instance + * @return list of native modules to register with the newly created catalyst instance This method + * is deprecated in the new Architecture of React Native. */ @NonNull + @DeprecatedInNewArchitecture List createNativeModules(@NonNull ReactApplicationContext reactContext); /** @return a list of view managers that should be registered with {@link UIManagerModule} */