diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.cpp b/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.cpp index cf165e30e1215f..fe2411974d20cd 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.cpp @@ -40,7 +40,6 @@ TurboModule::TurboModule( : name_(std::move(name)), jsInvoker_(std::move(jsInvoker)) {} void TurboModule::emitDeviceEvent( - jsi::Runtime& runtime, const std::string& eventName, ArgFactory argFactory) { jsInvoker_->invokeAsync([eventName, argFactory](jsi::Runtime& rt) { diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.h b/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.h index ccd9d1f85968ef..b881d6e79964ee 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.h +++ b/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.h @@ -106,10 +106,17 @@ class JSI_EXPORT TurboModule : public facebook::jsi::HostObject { * }); */ void emitDeviceEvent( - jsi::Runtime& runtime, const std::string& eventName, ArgFactory argFactory = nullptr); + // Backwards compatibility version + void emitDeviceEvent( + jsi::Runtime& runtime, + const std::string& eventName, + ArgFactory argFactory = nullptr) { + emitDeviceEvent(eventName, argFactory); + } + virtual jsi::Value create( jsi::Runtime& runtime, const jsi::PropNameID& propName) { diff --git a/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.cpp b/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.cpp index abec005d02e00b..0bbc831d838156 100644 --- a/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.cpp +++ b/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.cpp @@ -184,7 +184,6 @@ void NativeCxxModuleExample::emitCustomDeviceEvent( // Test emitting device events (RCTDeviceEventEmitter.emit) from C++ // TurboModule with arbitrary arguments emitDeviceEvent( - rt, eventName.utf8(rt).c_str(), [](jsi::Runtime& rt, std::vector& args) { args.emplace_back(jsi::Value(true));