Skip to content

Commit d70b2c2

Browse files
committed
Repro for unexpected label as value block terminal
This was one of the last invariants firing internally, this PR adds a minimal repro and the next PR makes it a todo.
1 parent 459679f commit d70b2c2

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
## Input
3+
4+
```javascript
5+
function Component(props) {
6+
return (
7+
useMemo(() => {
8+
return [props.value];
9+
}) || []
10+
);
11+
}
12+
13+
```
14+
15+
16+
## Error
17+
18+
```
19+
1 | function Component(props) {
20+
2 | return (
21+
> 3 | useMemo(() => {
22+
| ^^^^^^^^^^^^^^^
23+
> 4 | return [props.value];
24+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
25+
> 5 | }) || []
26+
| ^^^^^^^^^^^^^ [ReactForget] Invariant: Unexpected value block terminal kind 'label' (3:5)
27+
6 | );
28+
7 | }
29+
8 |
30+
```
31+
32+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
function Component(props) {
2+
return (
3+
useMemo(() => {
4+
return [props.value];
5+
}) || []
6+
);
7+
}

0 commit comments

Comments
 (0)