Files
react/compiler/crates/react_hermes_parser/tests/fixtures/reassignment-separate-scopes.js
2024-04-02 16:49:31 -07:00

26 lines
289 B
JavaScript

function foo(a, b, c) {
let x = [];
if (a) {
x.push(a);
}
let y = <div>{x}</div>;
switch (b) {
case 0: {
x = [];
x.push(b);
break;
}
default: {
x = [];
x.push(c);
}
}
return (
<div>
{y}
{x}
</div>
);
}