mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Introduce ReactContext.hasReactInstance() (#44116)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44116 This is just the bridgeless analogue to .hasCatalystInstance() Changelog: [Android][Added] - Introduced ReactContext.hasReactInstance() to replace .hasCatalystInstance() Reviewed By: fabriziocucci Differential Revision: D56164488 fbshipit-source-id: 8be4676e18dc7df4765746f46cf36e62405b4ffa
This commit is contained in:
committed by
Facebook GitHub Bot
parent
94a58a8e42
commit
3a3f3e6232
@@ -1114,6 +1114,7 @@ public abstract class com/facebook/react/bridge/ReactContext : android/content/C
|
||||
public fun hasCatalystInstance ()Z
|
||||
public fun hasCurrentActivity ()Z
|
||||
public fun hasNativeModule (Ljava/lang/Class;)Z
|
||||
public fun hasReactInstance ()Z
|
||||
protected fun initializeInteropModules ()V
|
||||
protected fun initializeInteropModules (Lcom/facebook/react/bridge/ReactContext;)V
|
||||
public fun initializeMessageQueueThreads (Lcom/facebook/react/bridge/queue/ReactQueueConfiguration;)V
|
||||
|
||||
+10
@@ -262,10 +262,20 @@ public abstract class ReactContext extends ContextWrapper {
|
||||
return mCatalystInstance != null && !mCatalystInstance.isDestroyed();
|
||||
}
|
||||
|
||||
/**
|
||||
* This API has been deprecated due to naming consideration, please use hasReactInstance() instead
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean hasCatalystInstance() {
|
||||
return mCatalystInstance != null;
|
||||
}
|
||||
|
||||
public boolean hasReactInstance() {
|
||||
return mCatalystInstance != null;
|
||||
}
|
||||
|
||||
public LifecycleState getLifecycleState() {
|
||||
return mLifecycleState;
|
||||
}
|
||||
|
||||
+5
@@ -95,6 +95,11 @@ class BridgelessReactContext extends ReactApplicationContext implements EventDis
|
||||
return mReactHost.isInstanceInitialized();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasReactInstance() {
|
||||
return mReactHost.isInstanceInitialized();
|
||||
}
|
||||
|
||||
DevSupportManager getDevSupportManager() {
|
||||
return mReactHost.getDevSupportManager();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user