1
0
Fork 0

Do not create listeners on each focus

Dieser Commit ist enthalten in:
Arnaud Vergnet 2020-04-08 12:32:08 +02:00
Ursprung a54493a23f
Commit 8e2d1c7a2b

Datei anzeigen

@ -68,6 +68,8 @@ class HomeScreen extends React.Component<Props> {
componentDidMount() {
this.props.navigation.addListener('focus', this.onScreenFocus);
// Handle link open when home is focused
this.props.navigation.addListener('state', this.handleNavigationParams);
}
onScreenFocus = () => {
@ -77,8 +79,6 @@ class HomeScreen extends React.Component<Props> {
headerRight: this.getHeaderButton,
});
}
// Handle link open when home is focused
this.props.navigation.addListener('state', this.handleNavigationParams);
// handle link open when home is not focused or created
this.handleNavigationParams();
};