Closed FuYiCai closed 4 years ago
找到了把componentDidMount() { this.timer = setInterval(() => { this.setState({ active: !this.state.active }) }, 600) }
componentWillUnmount() { if (this.timer) { clearInterval(this.timer) } }
换成componentDidShow 和 componentDidShow就好了
进入pages/user/user页面后,再去点击其他页面,Activity组件的定时器一直在运行呢