Closed
Description
This is the same as https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-access-state-in-setstate.md
The purpose: to deny using this.state
inside this.setState
call.
Why: Given this.setState
mutates the state asynchronously it's extremely easy to introduce a subtle bug when in 2 sequential calls one relies on a particular this.state
state. And if those this.setState
calls are in different functions and spatially not even close the problem might be really challenging to debug.