Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/error.invalid-property-store-to-frozen-value.expect.md
2026-08-27 21:09:14 +00:00

521 B

Input

function Component(props) {
  const x = makeObject();
  // freeze
  <div>{x}</div>;
  x.y = true;
  return x;
}

Error

Found 1 error:

Error: This value cannot be modified

Modifying a value used previously in JSX is not allowed. Consider moving the modification before the JSX.

error.invalid-property-store-to-frozen-value.ts:5:2
  3 |   // freeze
  4 |   <div>{x}</div>;
> 5 |   x.y = true;
    |   ^ value cannot be modified
  6 |   return x;
  7 | }
  8 |