Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/await-side-effecting-promise.expect.md
2026-08-27 21:09:14 +00:00

430 B

Input

async function Component(props) {
  const x = [];
  await populateData(props.id, x);
  return x;
}

Code

import { c as _c } from "react/compiler-runtime";
async function Component(props) {
  const $ = _c(2);
  let x;
  if ($[0] !== props.id) {
    x = [];
    await populateData(props.id, x);
    $[0] = props.id;
    $[1] = x;
  } else {
    x = $[1];
  }
  return x;
}