When i press back button getting this issue: TypeError: Cannot read properties of null (reading 'remove')
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch [email protected] for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-modal/dist/modal.js b/node_modules/react-native-modal/dist/modal.js
index 80f4e75..c6db3c5 100644
--- a/node_modules/react-native-modal/dist/modal.js
+++ b/node_modules/react-native-modal/dist/modal.js
@@ -458,7 +458,8 @@ export class ReactNativeModal extends React.Component {
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.onBackButtonPress);
if (this.didUpdateDimensionsEmitter) {
- this.didUpdateDimensionsEmitter.remove();
+ DeviceEventEmitter.removeAllListeners('didUpdateDimensions')
+ // this.didUpdateDimensionsEmitter.remove();
}
if (this.interactionHandle) {
InteractionManager.clearInteractionHandle(this.interactionHandle);
This issue body was partially generated by patch-package.
@harish92 getting this error on pressing back button ERROR TypeError: Cannot read property 'remove' of undefined
code as added below
componentWillUnmount() { BackHandler.removeEventListener('hardwareBackPress', this.onBackButtonPress); DeviceEventEmitter.removeListener.remove('didUpdateDimensions', this.handleDimensionsUpdate); if (this.interactionHandle) { InteractionManager.clearInteractionHandle(this.interactionHandle); this.interactionHandle = null; } }
using this version of "react-native-modal": "^12.0.2",
note:- also tried with DeviceEventEmitter.removeAllListeners.remove('didUpdateDimensions', this.handleDimensionsUpdate);
getting error --** ERROR TypeError: undefined is not a function**
and DeviceEventEmitter.removeAllListeners('didUpdateDimensions', this.handleDimensionsUpdate);
in this case state got empty values and remaining pages also have same issue even no API call making.
hi guys! is there any updates about this? I'm also facing the same issue with a react native expo project with a managed workflow, it crashes the app on build.
I see this warning when running from expo start.

Facing same issue :/ any update?
Same issue after upgrading to React Native 0.72
Facing issue after upgrading to React Native 0.73.2