What is the use of prevstate?

后端 未结 0 1558
[愿得一人]
[愿得一人] 2021-01-25 14:05

When we dont use prevstate, the code is like this:

state = {
   count: 0
}
updateCount = () => {
    this.setState({ count: this.state.count + 1}); \\\\count =         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题