mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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:
+32
@@ -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 |
|
||||
```
|
||||
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
function Component(props) {
|
||||
return (
|
||||
useMemo(() => {
|
||||
return [props.value];
|
||||
}) || []
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user