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.
This commit is contained in:
Joe Savona
2024-03-13 22:20:56 -07:00
parent 459679f91e
commit d70b2c2c4e
2 changed files with 39 additions and 0 deletions
@@ -0,0 +1,32 @@
## Input
```javascript
function Component(props) {
return (
useMemo(() => {
return [props.value];
}) || []
);
}
```
## Error
```
1 | function Component(props) {
2 | return (
> 3 | useMemo(() => {
| ^^^^^^^^^^^^^^^
> 4 | return [props.value];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 5 | }) || []
| ^^^^^^^^^^^^^ [ReactForget] Invariant: Unexpected value block terminal kind 'label' (3:5)
6 | );
7 | }
8 |
```
@@ -0,0 +1,7 @@
function Component(props) {
return (
useMemo(() => {
return [props.value];
}) || []
);
}