我的问题是setTimeout会运行about 5 seconds
年前.
我甚至调查了这个问题:setTimeout in React Native,但我仍然无法解决这个问题
changeNotify() {
let that = this;
console.log("before");
setTimeout(function () {
console.log("After");
that.setState({notifyModal: false})
}, 5000);
}
在渲染中
<Button
title='change'
onPress={() => this.setState({notifyModal: true},()=>this.changeNotify())}
/>