setState({ count: this.state.count + 1 })}> Click me </button> </div> ); } } ... 我们可以在effect 中获取到最新的 count 值,因为他在函数的作用域内。
確定! 回上一頁