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
This commit is contained in:
Lulu Wu
2021-04-02 12:29:58 -07:00
committed by Facebook GitHub Bot
parent b5e649fcf6
commit 1b50722a7e
@@ -170,6 +170,17 @@ public class ReactContext extends ContextWrapper {
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();