Repro for "expect trees to be >=2 elements long" invariant

These cases have a switch with only a default, so we create a "conditional" 
child dependency tree and no other trees which hits the invariant.
This commit is contained in:
Joe Savona
2024-03-22 08:53:30 -07:00
parent ee93b62f51
commit 3229302222
2 changed files with 27 additions and 0 deletions
@@ -0,0 +1,21 @@
## Input
```javascript
function Component({ kind, ...props }) {
switch (kind) {
default:
return <Stringify {...props} />;
}
}
```
## Error
```
[ReactForget] Invariant: Expected trees to be at least 2 elements long.
```
@@ -0,0 +1,6 @@
function Component({ kind, ...props }) {
switch (kind) {
default:
return <Stringify {...props} />;
}
}