Skip to content
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

Merged
merged 2 commits into from Aug 23, 2021

Conversation

lubomyr
Copy link
Contributor

@lubomyr lubomyr commented Aug 20, 2021

…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

…rgument without the required addListener and removeListener methods' on react-native 0.65 and android platform
Copy link
Contributor

@mikehardy mikehardy left a 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

@lubomyr
Copy link
Contributor Author

lubomyr commented Aug 20, 2021

@mikehardy, I didn't notice any warnings on ios side, but will try to add this changes in PR

@lubomyr
Copy link
Contributor Author

lubomyr commented Aug 20, 2021

@mikehardy , added requested changes for IOS, but not sure if it added in correct place, can you check it ?

Copy link
Contributor

@mikehardy mikehardy left a 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!

@matt-oakes matt-oakes merged commit ac0ed65 into react-native-netinfo:master Aug 23, 2021
github-actions bot pushed a commit that referenced this pull request Aug 24, 2021
## [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))
@matt-oakes
Copy link
Collaborator

🎉 This PR is included in version 6.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mikehardy
Copy link
Contributor

@lubomyr I found the root cause on this one and proposed a sketch to fix if you want to try again? explained as last comment on #486

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants