Skip to content

Commit

Permalink
[compiler] Fix broken fire snapshot
Browse files Browse the repository at this point in the history
This was not committed in #31811
  • Loading branch information
poteto committed Dec 26, 2024
1 parent 97d7949 commit 32defc5
Showing 1 changed file with 13 additions and 10 deletions.
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;
```

0 comments on commit 32defc5

Please sign in to comment.