Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/optional-call-with-independently-memoizable-arg.js
2026-08-27 21:09:14 +00:00

14 lines
432 B
JavaScript

function Component(props) {
const x = makeOptionalFunction(props);
// for a regular call, the JSX element could be independently memoized
// since it is an immutable value. however, because the call is optional,
// we can't extract out independent memoization for the element w/o
// forcing that argument to evaluate unconditionally
const y = x?.(
<div>
<span>{props.text}</span>
</div>
);
return y;
}