diff --git a/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp b/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp index f61f46f2cfe1..1e90273192ba 100644 --- a/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +++ b/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp @@ -77,16 +77,16 @@ std::optional 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),