react native 安卓home返回键页面刷新

时间:2024-03-24 21:03:44
import { withNavigationFocus } from 'react-navigation';
class Warngreete extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.reload();
}

    
componentWillReceiveProps(newProps) {
if(newProps.isFocused){
this.reload();
}
} //页面执行函数
reload(){}
}
export default withNavigationFocus(Warngreete);