Open
Description
From the React 16.2 docs:
setState() does not always immediately update the component. It may batch or defer the update until later. This makes reading this.state right after calling setState() a potential pitfall. Instead, use componentDidUpdate or a setState callback (setState(updater, callback)), either of which are guaranteed to fire after the update has been applied. If you need to set the state based on the previous state, read about the updater argument below.
In addition to this being effectively a race condition now, I would imagine that the race will get hit more often once React 16 allows for async rendering.
It would be wonderful to have a rule to flag this.