question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RN 0.65.1 warning EventEmitter.removeListener('change', ...)

See original GitHub issue

Current behaviour

When I use the Menu component, I have some warning like this :

EventEmitter.removeListener(‘change’, …): Method has been deprecated. Please instead use remove() on the subscription returned by EventEmitter.addListener.

Expected behaviour

When I close a screen with Menu componant, I have this error

Code sample

Screenshots (if applicable)

What have you tried

I think that problème is in this code

file main/src/components/Menu/Menu.tsx

private removeListeners = () => {
    BackHandler.removeEventListener('hardwareBackPress', this.handleDismiss);
    Dimensions.removeEventListener('change', this.handleDismiss);

    this.isBrowser() &&
      document.removeEventListener('keyup', this.handleKeypress);
  };

Your Environment

software version
ios or android Android
react-native 0.65.1
react-native-paper 4.9.2
node 14.1.0
npm or yarn npm
expo sdk n/a

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
lukewalczakcommented, Oct 8, 2021

I just fixed the issue, however new version is not released yet. In the meantime you can install the latest react-native-paper version from the branch/commit.

0reactions
evereststercommented, Sep 30, 2021

I got the same problem with Menu.Item component. Posted the issue here : https://github.com/fateh999/react-native-paper-dropdown/issues/34

Read more comments on GitHub >

github_iconTop Results From Across the Web

EventEmitter.removeListener('change', ...): Method ... - GitHub
Current behavior WARN EventEmitter. ... Hi All, I am new to the react native and getting the same issue in react native 0.65.1....
Read more >
React Native Warning: Receiving warning from the console
removeListener (\'change\', ...): Method has been deprecated. Please instead use `remove()` on the subscription returned by `EventEmitter.
Read more >
React Native - EventEmitter removeListener Method has been ...
Warning : Receiving warning on the console. removeListener Method has been deprecated. EventEmitter.removeListener('appStateDidChange', …): ...
Read more >
`new nativeeventemitter()` was called with a non-null ...
Using this library in RN 67 throws this warning: new NativeEventEmitter() was called with a non-null argument without the required removeListeners method.) It ......
Read more >
What does these two warnings mean? : r/reactnative - Reddit
addEventListener("change", _handleAppStateChange); return () => { AppState.removeEventListener("change", _handleAppStateChange); }; }, []);. Do ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found