Environment
Environment:
OS: macOS High Sierra 10.13.4
Node: 8.9.0
Yarn: 1.2.1
npm: 5.5.1
Watchman: 4.9.0
Xcode: Xcode 9.3.1 Build version 9E501
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: ^16.3.0-alpha.1 => 16.3.0
react-native: 0.54.3 => 0.54.3
Description
I have two or more Objective-C Classes that extend RCTEventEmitter and conform to RCTBridgeModule.
They all return same event names in - (NSArray<NSString *> *)supportedEvents;:


At JavaScript side, I use NativeEventEmitter to listen myEvent of these native classes. However, I need to make sure there's only one listener around so I remove all existing listeners before adding new one. It works fine when I only manipulate one single native module:

When it comes to two or more, like:

I got this red screen:

I still got this red screen even if I wrote like this:

Steps to Reproduce
- Two or more Native Classes that extends
RCTEventEmitter and conform to RCTBridgeModule and has some same event names.
- At Javascript side, try to remove listeners.
- Get red screen.
Expected Behavior
- Every native class should manage its own events, even if it has same event names with other native classes
react-native infoin your terminal and paste its contents under "Environment"share an app that reproduces the issue using https://snack.expo.io/
Environment
Environment:
OS: macOS High Sierra 10.13.4
Node: 8.9.0
Yarn: 1.2.1
npm: 5.5.1
Watchman: 4.9.0
Xcode: Xcode 9.3.1 Build version 9E501
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: ^16.3.0-alpha.1 => 16.3.0
react-native: 0.54.3 => 0.54.3
Description
I have two or more Objective-C Classes that extend


RCTEventEmitterand conform toRCTBridgeModule.They all return same event names in
- (NSArray<NSString *> *)supportedEvents;:At JavaScript side, I use

NativeEventEmitterto listenmyEventof these native classes. However, I need to make sure there's only one listener around so I remove all existing listeners before adding new one. It works fine when I only manipulate one single native module:When it comes to two or more, like:

I got this red screen:

I still got this red screen even if I wrote like this:

Steps to Reproduce
RCTEventEmitterand conform toRCTBridgeModuleand has some same event names.Expected Behavior