From 1a1649880279f2b03727199edd3c159a1725aa2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 17 Feb 2025 11:32:33 -0800 Subject: [PATCH] ] Fix native module check when not using batched bridge Summary: Changelog: [internal] Differential Revision: D69753755 --- .../jsiexecutor/jsireact/JSINativeModules.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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),