Reputation: 2217
React's official document says that React components will automatically start to re-render component on setState()
calls. Does that mean any codes below the setState()
won't get executed ever?
Upvotes: 1
Views: 278
Reputation: 47222
Yes, code below this.setState
will always be executed unless you return this.setState
of course.
However a thing to note with calls to this.setState
is not guaranteed to be synchronous, meaning calls can and will be batched if React deems necessary.
Upvotes: 3