New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed warnings 'new NativeEventEmitter() was called with a non-null a… #487
Conversation
…rgument without the required addListener and removeListener methods' on react-native 0.65 and android platform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the iOS side will need the same stubs? For example:
RCT_EXPORT_METHOD(addListener : (NSString *)eventName) {
// Keep: Required for RN built in Event Emitter Calls.
}
RCT_EXPORT_METHOD(removeListeners : (NSInteger)count) {
// Keep: Required for RN built in Event Emitter Calls.
}
in RNCNetInfo.m
@mikehardy, I didn't notice any warnings on ios side, but will try to add this changes in PR |
… for compatibility rn-0.65
@mikehardy , added requested changes for IOS, but not sure if it added in correct place, can you check it ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
## [6.0.1](v6.0.0...v6.0.1) (2021-08-24) ### Bug Fixes * Ensure warnings are not shown on React Native 0.65 ([#487](#487) by [@lubomyr](https://github.com/lubomyr)) ([ac0ed65](ac0ed65)) * **android:** isConnected is incorrect for wifi networks only the app has access to ([#443](#443) by [@eliaslecomte](https://github.com/eliaslecomte)) ([7084771](7084771))
🎉 This PR is included in version 6.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
- warnings at startup: - new NativeEventEmitter called with non-null argument without the required addListener method - new NativeEventEmitter called with non-null argument without the required removeListeners method - related to RN 0.65 - ref: - https://reactnative.dev/docs/native-modules-android#sending-events-to-javascript - react-native-netinfo/react-native-netinfo#486 - react-native-netinfo/react-native-netinfo#487 - https://github.com/react-native-netinfo/react-native-netinfo/blob/master/CHANGELOG.md#601-2021-08-24 - react-native-webrtc/react-native-webrtc#1072 - facebook/react-native@114be1d - RevenueCat/react-native-purchases#339
…rgument without the required addListener and removeListener methods' on react-native 0.65 and android platform
Overview
This PR fix warns
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.
on Android platform with react-native 0.65 (0.65.0, 0.65.1, and probably next higher versions)
Issue: #486
Test Plan