类组件中setState更新状态不同写法定时器结果不同 使用解构 componentDidMount() { const { n } = this.state this.timer = setInterval(() => { this.setState({ n: n + 1 }) }, 1000); } 不使用解构 componentDidMount() { this.timer = setInterval(() => { this.setState({ n: this.state.n + 1 }) }, 1000); } 为什么两种答案不一样呢,第一个只触发一次,第二个定时器有效,按理来说setState是异步的都不能出发定时器啊,有大佬帮忙解释一下吗