Files
react/compiler/crates/react_hermes_parser/tests/fixtures/computed-load-primitive-as-dependency.js
2024-04-02 16:49:31 -07:00

10 lines
207 B
JavaScript

function Component(props) {
let a = foo();
// freeze `a` so we know the next line cannot mutate it
<div>{a}</div>;
// b should be dependent on `props.a`
let b = bar(a[props.a] + 1);
return b;
}