mirror of
https://github.com/facebook/react.git
synced 2026-02-26 04:14:59 +00:00
13 lines
242 B
JavaScript
13 lines
242 B
JavaScript
function Component(props) {
|
|
let y = 0;
|
|
const [x, setX] = useState(0);
|
|
|
|
const foo = () => {
|
|
setX(1);
|
|
y = 1; // TODO: force foo's mutable range to extend, but ideally we can just remove this line
|
|
};
|
|
foo();
|
|
|
|
return [x, y];
|
|
}
|