
SetState() Gate: Navigating React SetState() Behavior Confusion - ericelliott
https://medium.com/javascript-scene/setstate-gate-abc10a9b2d82#.8yqb01kch
======
iEchoic
> I still bump into rough edges now and then when I’m dealing with forms or
> DOM element coordinates because, when you use setState(), you have to deal
> with the component lifecycle directly.

Do you have an example of this? Why do you have to deal with the component
lifecycle directly because of setState?

Agreed that it's not intuitive from the API signature that setState is an
asynchronous operation, and this can trip up new devs the first time. This is
a recognized and non-controversial point of confusion. I've never seen this be
a substantial issue in real life, though. The article mentions having to
frequently hack around setState's behavior, but I don't think I've seen this
in any of the codebases I've worked in. I've also seen developers that are new
to react get confused by this behavior initially, but never repeatedly after
the first time.

