Commit af29a26
committed
[eslint] Do not allow useEffectEvent fns to be called in arbitrary closures (#33544)
Summary:
useEffectEvent is meant to be used specifically in combination with
useEffect, and using
the feature in arbitrary closures can lead to surprising reactivity
semantics. In order to
minimize risk in the experimental rollout, we are going to restrict its
usage to being
called directly inside an effect or another useEffectEvent, effectively
enforcing the function
coloring statically. Without an effect system this is the best we can
do.
DiffTrain build for [97cdd5d](97cdd5d)1 parent 4ab994b commit af29a26
File tree
35 files changed
+93
-91
lines changed- compiled
- eslint-plugin-react-hooks
- facebook-www
35 files changed
+93
-91
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55210 | 55210 | | |
55211 | 55211 | | |
55212 | 55212 | | |
55213 | | - | |
55214 | | - | |
55215 | | - | |
| 55213 | + | |
| 55214 | + | |
| 55215 | + | |
| 55216 | + | |
| 55217 | + | |
| 55218 | + | |
55216 | 55219 | | |
55217 | 55220 | | |
55218 | | - | |
55219 | | - | |
| 55221 | + | |
55220 | 55222 | | |
55221 | 55223 | | |
55222 | 55224 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1434 | 1434 | | |
1435 | 1435 | | |
1436 | 1436 | | |
1437 | | - | |
| 1437 | + | |
1438 | 1438 | | |
1439 | 1439 | | |
1440 | 1440 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1434 | 1434 | | |
1435 | 1435 | | |
1436 | 1436 | | |
1437 | | - | |
| 1437 | + | |
1438 | 1438 | | |
1439 | 1439 | | |
1440 | 1440 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
613 | | - | |
| 613 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
613 | | - | |
| 613 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
617 | | - | |
| 617 | + | |
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
617 | | - | |
| 617 | + | |
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19299 | 19299 | | |
19300 | 19300 | | |
19301 | 19301 | | |
19302 | | - | |
| 19302 | + | |
19303 | 19303 | | |
19304 | 19304 | | |
19305 | | - | |
| 19305 | + | |
19306 | 19306 | | |
19307 | 19307 | | |
19308 | 19308 | | |
| |||
19336 | 19336 | | |
19337 | 19337 | | |
19338 | 19338 | | |
19339 | | - | |
| 19339 | + | |
19340 | 19340 | | |
19341 | 19341 | | |
19342 | 19342 | | |
| |||
0 commit comments