由於 this.props 與 this.state 的更新可能是非同步的,所以不可以直接根據其值來計算: // 錯誤用法 this.setState({ counter: this.state.counter + ...
確定! 回上一頁