我通过以下方式添加了侦听器(尝试同时放入构造函数和 componentDidMount): AppState.addEventListener('change', this._handleAppStateChange);
并在 componentWillUnmount 方法中通过以下方式删除了侦听器:
AppState.removeEventListener('change', this._handleAppStateChange);
并且在回调函数中:
_handleAppStateChange = (nextAppState) => {
setTimeout(() => {
alert('App state: ' + this.state.appState);
alert('Next App state: ' + nextAppState);
}, 0);
}
Run Code Online (Sandbox Code Playgroud)
它会提醒几次。它不会删除一次配置的侦听器。如果有人知道的话请告诉我?
我想通过将 Bitbucket IP 添加到 EC2 实例的安全组来将其列入白名单。
我已按照链接上的步骤操作: https ://bitbucket.org/blog/new-ip-addresses-bitbucket-cloud
我添加了以下IP:
IPv4:18.205.93.0/25、18.234.32.128/25 和 13.52.5.0/25
但 Bitbucket 管道仍然无法连接到 EC2 实例。
有人可以帮我吗?