Replies: 2 comments 11 replies
-
@joemun Maybe take a look here: https://github.com/react-native-community/RNNewArchitectureLibraries/tree/feat/swift-event-emitter (If you did not know it existed :) ) It's for iOS only unfortunately, but it states:
But I've already noticed, that the Android Spec Interface forces you to implement |
Beta Was this translation helpful? Give feedback.
-
The recommended API to dispatch events in the New Architecture (and also in the old one) on Android is the Event Dispatcher. You can find an example of its usage here: #137 (comment) |
Beta Was this translation helpful? Give feedback.
-
👋 I'm having trouble finding official guidance/examples on the migration path for event emitters from Native Modules to Turbo Modules. Per https://reactnative.dev/docs/native-modules-android#sending-events-to-javascript, do Turbo Modules still support adding JS event listeners using
NativeEventEmitter
?Is it possible to define listeners in the JS spec? And for Android, what should the implementation look like? (ie. still create functions for
@ReactMethod addListener
and@ReactMethod removeListeners
?)Thanks!
Beta Was this translation helpful? Give feedback.
All reactions