Create V2 EventEmitter (ModernEventEmitter) interface that surfaceId can be passed into

Summary:
Create V2 EventEmitter that surfaceId can be passed into, with a backwards-compat layer, and some debug-only logging to help assist with migration.

Changelog: [Changed][Android] RCTEventEmitter has been deprecated in favor of RCTModernEventEmitter for optimal Fabric support; RCTEventEmitter will continue to work in Fabric, but there are minor perf implications.

Reviewed By: mdvacca

Differential Revision: D26027104

fbshipit-source-id: 784ca092bbc88d19c82f6c42537c34460d96de86
This commit is contained in:
Joshua Gross
2021-01-22 19:32:14 -08:00
committed by Facebook GitHub Bot
parent 8357b39908
commit 2fbbdbb2ce
8 changed files with 111 additions and 11 deletions
@@ -125,8 +125,20 @@ public interface UIManager extends JSIModule, PerformanceCounter {
* @param eventName name of the event
* @param event parameters
*/
@Deprecated
void receiveEvent(int reactTag, String eventName, @Nullable WritableMap event);
/**
* This method dispatches events from RN Android code to JS. The delivery of this event will not
* be queued in EventDispatcher class.
*
* @param surfaceId
* @param reactTag tag
* @param eventName name of the event
* @param event parameters
*/
void receiveEvent(int surfaceId, int reactTag, String eventName, @Nullable WritableMap event);
/** Resolves Direct Event name exposed to JS from the one known to the Native side. */
@Deprecated
@Nullable