You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior is a naive conversion between this.setState and this.*.
setState is more complicated then this, however.
It takes a second argument which is a callback when the setState has been applied.
It can take a function which takes the previous and current props and returns the next state.
Also in general the semantics are not 100% similar. If I'm not mistaken, this.setState doesn't even mutate the state right away, while obviously this.* does, just that the DOM updates get batched. I have no idea if this difference will be a cause of bugs...I guess time and lot's of testing will tell.
The text was updated successfully, but these errors were encountered:
@blocka, you're right, we'll increase the transpilation success rate with time but obviously it's impossible to make 100% compilant converter, however, if you could provide few examples where it's wrong we would be able to at least cover that cases, I'll try to implement setState callback for now.
Current behavior is a naive conversion between
this.setState
andthis.*
.setState is more complicated then this, however.
Also in general the semantics are not 100% similar. If I'm not mistaken,
this.setState
doesn't even mutate the state right away, while obviouslythis.*
does, just that the DOM updates get batched. I have no idea if this difference will be a cause of bugs...I guess time and lot's of testing will tell.The text was updated successfully, but these errors were encountered: