Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/sequential-destructuring-both-mixed-local-and-scope-declaration.js
2026-08-27 21:09:14 +00:00

34 lines
671 B
JavaScript

import {identity} from 'shared-runtime';
function Component(statusName) {
// status is local, text is a scope declaration
const {status, text} = foo(statusName);
// color is local, font is a scope declaration
const {color, font} = getStyles(status);
// bg is a declaration
const bg = identity(color);
return (
<div className={bg}>
<span className={font}>{[text]}</span>
</div>
);
}
function foo(name) {
return {
status: `<status>`,
text: `${name}!`,
};
}
function getStyles(status) {
return {
font: 'comic-sans',
color: '#657b83',
};
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: ['Sathya'],
};