mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
TurboModule::emitDeviceEvent doesn't require jsi::Runtime argument anymore (#43376)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43376 ## Changelog: [Internal] - Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of. Reviewed By: rubennorte Differential Revision: D54643903 fbshipit-source-id: 25cea413e66c6e76c958395879db1169899e3bc9
This commit is contained in:
committed by
Facebook GitHub Bot
parent
76ce789014
commit
6c28c87c4d
@@ -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<jsi::Value>& args) {
|
||||
args.emplace_back(jsi::Value(true));
|
||||
|
||||
Reference in New Issue
Block a user