From 1b50722a7e84cd8acffd3f0f84d77057e1e0d955 Mon Sep 17 00:00:00 2001 From: Lulu Wu Date: Fri, 2 Apr 2021 12:29:58 -0700 Subject: [PATCH] Add back hasActiveCatalystInstance() and mark it as Deprecated Summary: Previously I renamed hasActiveCatalystInstance() API in D27335055 (https://github.com/facebook/react-native/commit/dfa8eb0558338f18ea01f294a64d355f6deeff06), however this API is still used in an OSS class. In this diff hasActiveCatalystInstance() is added back and marked as Deprecated to avoid breakages and leave the migration choice to OSS users. Changelog: [Android][Changed] Mark hasActiveCatalystInstance() as Deprecated Reviewed By: yungsters Differential Revision: D27538449 fbshipit-source-id: 30f2f890580ad7f8b41908e18013234b5bac72e9 --- .../java/com/facebook/react/bridge/ReactContext.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java index 184619890efe38..f227f0da0629ba 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java @@ -170,6 +170,17 @@ public CatalystInstance getCatalystInstance() { return Assertions.assertNotNull(mCatalystInstance); } + /** + * This API has been deprecated due to naming consideration, please use hasActiveReactInstance() + * instead + * + * @return + */ + @Deprecated + public boolean hasActiveCatalystInstance() { + return hasActiveReactInstance(); + } + /** @return true if there is an non-null, alive react native instance */ public boolean hasActiveReactInstance() { return mCatalystInstance != null && !mCatalystInstance.isDestroyed();