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:
David Vacca
2019-12-10 20:33:55 -08:00
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);
}
}