File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
# Prevent using this.state within a this.setState (no-access-state-in-setstate)
2
2
3
- This rule should prevent usage of this.state inside setState calls.
4
- Such usage of this.state might result in errors when two state calls is
3
+ This rule should prevent usage of ` this.state ` inside ` setState ` calls.
4
+ Such usage of ` this.state ` might result in errors when two state calls are
5
5
called in batch and thus referencing old state and not the current
6
6
state. An example can be an increment function:
7
7
@@ -11,7 +11,7 @@ function increment() {
11
11
}
12
12
```
13
13
14
- If these two setState operations is grouped together in a batch it will
14
+ If these two ` setState ` operations is grouped together in a batch it will
15
15
look be something like the following, given that value is 1:
16
16
17
17
```
You can’t perform that action at this time.
0 commit comments