1
0
Ответвление 0
ответвлён от vergnet/application-amicale

Do not create listeners on each focus

Этот коммит содержится в:
Arnaud Vergnet 2020-04-08 12:32:08 +02:00
родитель a54493a23f
коммит 8e2d1c7a2b

Просмотреть файл

@ -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();
};