Files
react/compiler/crates/react_hermes_parser/tests/fixtures/capturing-function-conditional-capture-mutate.js
2024-04-02 16:49:31 -07:00

15 lines
303 B
JavaScript

// @debug
function component(a, b) {
let z = { a };
let y = b;
let x = function () {
if (y) {
// we don't know for sure this mutates, so we should assume
// that there is no mutation so long as `x` isn't called
// during render
maybeMutate(z);
}
};
return x;
}