From e57cd0916c70b39a4d2ebcdb4aa4a2167b08df94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 17 Feb 2025 12:49:32 -0800 Subject: [PATCH] ] 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 --- .../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 f61f46f2cfe..1e90273192b 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),