mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Expose getJSIModule as part of the ReactContext class
Summary: This diff exposes the getJSIModule on the ReactContext class. This class already has methods to obtain NativeModules and JSModules, it make sense to expose the getJSIModule method too. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D18862858 fbshipit-source-id: 95fe48c065266060c96fc40a002041ba398b3134
This commit is contained in:
committed by
Facebook Github Bot
parent
df32ab43fb
commit
c5efc63663
@@ -427,4 +427,12 @@ public class ReactContext extends ContextWrapper {
|
||||
public JavaScriptContextHolder getJavaScriptContextHolder() {
|
||||
return mCatalystInstance.getJavaScriptContextHolder();
|
||||
}
|
||||
|
||||
public JSIModule getJSIModule(JSIModuleType moduleType) {
|
||||
if (!hasActiveCatalystInstance()) {
|
||||
throw new IllegalStateException(
|
||||
"Unable to retrieve a JSIModule if CatalystInstance is not active.");
|
||||
}
|
||||
return mCatalystInstance.getJSIModule(moduleType);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user