] Fix native module check when not using batched bridge (#49483)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49483

Changelog: [internal]

Reviewed By: fabriziocucci

Differential Revision: D69753755

fbshipit-source-id: fe267ed60b5f7d6baac7dee5d7be0f733b34e9e9
This commit is contained in:
Rubén Norte
2025-02-17 12:49:32 -08:00
committed by Facebook GitHub Bot
parent 3a4798cc30
commit e57cd0916c
@@ -77,16 +77,16 @@ std::optional<Object> JSINativeModules::createModule(
ReactMarker::NATIVE_MODULE_SETUP_START, name.c_str());
}
if (!m_genNativeModuleJS) {
m_genNativeModuleJS =
rt.global().getPropertyAsFunction(rt, "__fbGenNativeModule");
}
auto result = m_moduleRegistry->getConfig(name);
if (!result.has_value()) {
return std::nullopt;
}
if (!m_genNativeModuleJS) {
m_genNativeModuleJS =
rt.global().getPropertyAsFunction(rt, "__fbGenNativeModule");
}
Value moduleInfo = m_genNativeModuleJS->call(
rt,
valueFromDynamic(rt, result->config),