Do not create listeners on each focus
这个提交包含在:
父节点
a54493a23f
当前提交
8e2d1c7a2b
共有 1 个文件被更改,包括 2 次插入 和 2 次删除
|
|
@ -68,6 +68,8 @@ class HomeScreen extends React.Component<Props> {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.navigation.addListener('focus', this.onScreenFocus);
|
this.props.navigation.addListener('focus', this.onScreenFocus);
|
||||||
|
// Handle link open when home is focused
|
||||||
|
this.props.navigation.addListener('state', this.handleNavigationParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
onScreenFocus = () => {
|
onScreenFocus = () => {
|
||||||
|
|
@ -77,8 +79,6 @@ class HomeScreen extends React.Component<Props> {
|
||||||
headerRight: this.getHeaderButton,
|
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
|
// handle link open when home is not focused or created
|
||||||
this.handleNavigationParams();
|
this.handleNavigationParams();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用