bastengao/react-native-serial-port-api

new NativeEventEmitter() warning

Closed this issue · 2 comments

I receive the following warnings while running the app(Android).

WARN new NativeEventEmitter() was called with a non-null argument without the required addListener method.
WARN new NativeEventEmitter() was called with a non-null argument without the required removeListeners method.

Info:

"react-native": "0.66.3"
"react-native-serial-port-api": "^1.3.2"

I just add two function to android/src/main/java/com/bastengao/serialport/SerialPortApiModule.java to tix the warning:

// Required for rn built in EventEmitter Calls.
@ReactMethod
public void addListener(String eventName) {

}

@ReactMethod
public void removeListeners(Integer count) {

}

I fixed in 1.3.4

same issue

"react": "18.2.0",
"react-native": "0.71.8",
"react-native-serial-port-api": "^1.4.0-rc.1",