mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
move more bugreporting logic to bugreporting module
Reviewed By: astreet Differential Revision: D3168205 fb-gh-sync-id: 3cf5691acb258f9741c61005bbec0a8507bc8162 fbshipit-source-id: 3cf5691acb258f9741c61005bbec0a8507bc8162
This commit is contained in:
committed by
Facebook Github Bot 3
parent
89340f1620
commit
4ddb7c59d0
@@ -104,12 +104,21 @@ public class ReactContext extends ContextWrapper {
|
||||
return mCatalystInstance.getJSModule(executorToken, jsInterface);
|
||||
}
|
||||
|
||||
public <T extends NativeModule> boolean hasNativeModule(Class<T> nativeModuleInterface) {
|
||||
if (mCatalystInstance == null) {
|
||||
throw new RuntimeException(
|
||||
"Trying to call native module before CatalystInstance has been set!");
|
||||
}
|
||||
return mCatalystInstance.hasNativeModule(nativeModuleInterface);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the instance of the specified module interface associated with this ReactContext.
|
||||
*/
|
||||
public <T extends NativeModule> T getNativeModule(Class<T> nativeModuleInterface) {
|
||||
if (mCatalystInstance == null) {
|
||||
throw new RuntimeException("Trying to invoke JS before CatalystInstance has been set!");
|
||||
throw new RuntimeException(
|
||||
"Trying to call native module before CatalystInstance has been set!");
|
||||
}
|
||||
return mCatalystInstance.getNativeModule(nativeModuleInterface);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user