Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/nested-function-shadowed-identifiers.js
2026-08-27 21:09:14 +00:00

17 lines
385 B
JavaScript

function Component(props) {
const [x, setX] = useState(null);
const onChange = e => {
let x = null; // intentionally shadow the original x
setX(currentX => currentX + x); // intentionally refer to shadowed x
};
return <input value={x} onChange={onChange} />;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: ['TodoAdd'],
isComponent: 'TodoAdd',
};