Files
react/compiler/crates/react_hermes_parser/tests/fixtures/error.invalid-freeze-mutable-lambda-mutate-local.js
2024-04-02 16:49:31 -07:00

10 lines
242 B
JavaScript

function Component(props) {
const x = {};
const onChange = (e) => {
// INVALID! should use copy-on-write and pass the new value
x.value = e.target.value;
setX(x);
};
return <input value={x.value} onChange={onChange} />;
}