📅  最后修改于: 2022-03-11 15:03:05.804000             🧑  作者: Mango
componentDidMount() {
this.interval = setInterval(() => this.setState({ time: this.state.time + 1 }), 1000 * 60);
this.handler = BackHandler.addEventListener('hardwareBackPress', () => {return true})
}
componentWillUnmount() {
clearInterval(this.interval)
this.handler.remove()
BackHandler.addEventListener('hardwareBackPress', () => {return false})
}