RN 0.65.1 warning EventEmitter.removeListener('change', ...)
See original GitHub issueCurrent 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:
- Created 2 years ago
- Reactions:7
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
I got the same problem with Menu.Item component. Posted the issue here : https://github.com/fateh999/react-native-paper-dropdown/issues/34