react-native中的window.reload()相当于什么?

时间:2016-12-20 12:27:26

标签: reactjs react-native react-native-router-flux

有没有办法在react-native中完全刷新整个场景而不更新状态或强制重新渲染?

例如:

refreshButton(){
    Actions.refresh()
}

P.S:我使用react-native-router-flux作为我的导航器。我确实尝试了Actions.refresh({key: "page_name"}),但它没有用。

1 个答案:

答案 0 :(得分:0)

import { NetInfo } from 'react-native';
// component did mount
NetInfo.isConnected.addEventListener(
    'change',
    this._handleConnectivityChange
);

_handleConnectivityChange = (isConnected) => {
this.setState({
  isConnected,
});
};
// remove listener on componentWillUnmount

更多信息here