Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/todo-global-property-load-cached.tsx
2026-08-27 21:09:14 +00:00

21 lines
599 B
TypeScript

import * as SharedRuntime from 'shared-runtime';
import {makeArray} from 'shared-runtime';
/**
* Here, we don't need to memoize SharedRuntime.Stringify as it is a PropertyLoad
* off of a global.
* TODO: in PropagateScopeDeps (hir), we should produce a sidemap of global rvals
* and avoid adding them to `temporariesUsedOutsideDefiningScope`.
*/
function Component({num}: {num: number}) {
const arr = makeArray(num);
return (
<SharedRuntime.Stringify value={arr.push(num)}></SharedRuntime.Stringify>
);
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{num: 2}],
};