阅读背景:

在React组件中多次使用this.setState会发生什么?

来源:互联网 

I wanted to check what happens when you use this.setState multiple times (2 times for the sake of the discussion). I thought that the component will be rendered twice but apparently it's rendered only once. Another expectation I had was that maybe the second call for setState will run over the first one, but you guessed it - worked fine.I wanted to check what happens when you use thi




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: