State Updates May Be Asynchronous
React may batch multiple
setState() calls into a single update for performance.
Because
this.props and this.state may be updated asynchronously, you should not rely on their values for calculating the next state.Reference
- https://facebook.github.io/react/docs/state-and-lifecycle.html#state-updates-may-be-asynchronous
댓글
댓글 쓰기