Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ function Component(props) {

const deps = [foo, props];

useEffect(() => {
fire(foo(props));
}, ...deps);
useEffect(
() => {
fire(foo(props));
},
...deps
);

return null;
}
Expand All @@ -25,13 +28,13 @@ function Component(props) {
## Error

```
11 | useEffect(() => {
12 | fire(foo(props));
> 13 | }, ...deps);
| ^^^^ Invariant: Cannot compile `fire`. You must use an array literal for an effect dependency array when that effect uses `fire()` (13:13)
14 |
15 | return null;
16 | }
13 | fire(foo(props));
14 | },
> 15 | ...deps
| ^^^^ Invariant: Cannot compile `fire`. You must use an array literal for an effect dependency array when that effect uses `fire()` (15:15)
16 | );
17 |
18 | return null;
```


Loading