mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Support ModuleHolder-based lazy init of C++ modules with C++ bridge on android
Reviewed By: AaaChiuuu Differential Revision: D4614479 fbshipit-source-id: 109ac34b8688f0113675e4a4479d1ddcc6169ed4
This commit is contained in:
committed by
Facebook Github Bot
parent
6410e256c5
commit
e622d51e20
@@ -11,6 +11,10 @@ JSCNativeModules::JSCNativeModules(std::shared_ptr<ModuleRegistry> moduleRegistr
|
||||
m_moduleRegistry(std::move(moduleRegistry)) {}
|
||||
|
||||
JSValueRef JSCNativeModules::getModule(JSContextRef context, JSStringRef jsName) {
|
||||
if (!m_moduleRegistry) {
|
||||
return Value::makeUndefined(context);
|
||||
}
|
||||
|
||||
std::string moduleName = String::ref(context, jsName).str();
|
||||
|
||||
const auto it = m_objects.find(moduleName);
|
||||
|
||||
Reference in New Issue
Block a user