-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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-router-flux/src/Router.js b/node_modules/react-native-router-flux/src/Router.js
index 6f595e4..c9baf20 100644
--- a/node_modules/react-native-router-flux/src/Router.js
+++ b/node_modules/react-native-router-flux/src/Router.js
@@ -6,6 +6,8 @@ import defaultStore from './defaultStore';
import pathParser from './pathParser';
class App extends React.Component {
+ hardwareBackPressSubscriber ;
+ urlSubscriber;
static propTypes = {
navigator: PropTypes.func,
backAndroidHandler: PropTypes.func,
@@ -22,17 +24,17 @@ class App extends React.Component {
};
componentDidMount() {
- BackHandler.addEventListener('hardwareBackPress', this.props.backAndroidHandler || this.onBackPress);
+ this.hardwareBackPressSubscriber = BackHandler.addEventListener('hardwareBackPress', this.props.backAndroidHandler || this.onBackPress);
// If the app was "woken up" by an external route.
Linking.getInitialURL().then(url => this.parseDeepURL(url));
// Add an event listener for further deep linking.
- Linking.addEventListener('url', this.handleDeepURL);
+ this.urlSubscriber = Linking.addEventListener('url', this.handleDeepURL);
}
componentWillUnmount() {
- BackHandler.removeEventListener('hardwareBackPress', this.props.backAndroidHandler || this.onBackPress);
- Linking.removeEventListener('url', this.handleDeepURL);
+ this.hardwareBackPressSubscriber.remove();
+ this.urlSubscriber.remove();
}
onBackPress = () => this.props.navigationStore.pop();This issue body was partially generated by patch-package.
1312128240, phatmovista, breewf, mtr1012, Nigh7Sh4de and 1 moreLuuchoRocha, 1312128240, webxanh, mtr1012 and Nigh7Sh4de
Metadata
Metadata
Assignees
Labels
No labels