-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
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-popover/lib/PopoverController.js b/node_modules/react-native-modal-popover/lib/PopoverController.js
index 005c07f..9a0eb11 100644
--- a/node_modules/react-native-modal-popover/lib/PopoverController.js
+++ b/node_modules/react-native-modal-popover/lib/PopoverController.js
@@ -62,10 +62,10 @@ class PopoverController extends React.PureComponent {
this.closePopover = () => this.setState({ showPopover: false });
}
componentDidMount() {
- react_native_1.Dimensions.addEventListener('change', this.onOrientationChange);
+ this.listener = react_native_1.Dimensions.addEventListener('change', this.onOrientationChange);
}
componentWillUnmount() {
- react_native_1.Dimensions.removeEventListener('change', this.onOrientationChange);
+ this.listener?.remove?.();
}
render() {
return this.props.children({
diff --git a/node_modules/react-native-modal-popover/lib/usePopover.js b/node_modules/react-native-modal-popover/lib/usePopover.js
index 75cc72a..820f98d 100644
--- a/node_modules/react-native-modal-popover/lib/usePopover.js
+++ b/node_modules/react-native-modal-popover/lib/usePopover.js
@@ -45,9 +45,9 @@ function usePopover(calculateStatusBar = false) {
requestAnimationFrame(openPopover);
}
};
- react_native_1.Dimensions.addEventListener('change', onOrientationChange);
+ const listener = react_native_1.Dimensions.addEventListener('change', onOrientationChange);
return () => {
- react_native_1.Dimensions.removeEventListener('change', onOrientationChange);
+ listener?.remove?.();
};
}, [showPopover, openPopover]);
return result;
This issue body was partially generated by patch-package.
danieloi
Metadata
Metadata
Assignees
Labels
No labels