Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/error.hook-call-freezes-captured-memberexpr.jsx
2026-08-27 21:09:14 +00:00

21 lines
430 B
React

// @enableTransitivelyFreezeFunctionExpressions
import {mutate, Stringify, useIdentity} from 'shared-runtime';
function Foo({count}) {
const x = {value: 0};
/**
* After this custom hook call, it's no longer valid to mutate x.
*/
const cb = useIdentity(() => {
x.value++;
});
x.value += count;
return <Stringify x={x} cb={cb} />;
}
export const FIXTURE_ENTRYPOINT = {
fn: Foo,
params: [{count: 1}],
};