main
js 16 lines 385 Bytes
Raw
1 function Component(props) {
2 const [x, setX] = useState(null);
3
4 const onChange = e => {
5 let x = null; // intentionally shadow the original x
6 setX(currentX => currentX + x); // intentionally refer to shadowed x
7 };
8
9 return <input value={x} onChange={onChange} />;
10 }
11
12 export const FIXTURE_ENTRYPOINT = {
13 fn: Component,
14 params: ['TodoAdd'],
15 isComponent: 'TodoAdd',
16 };