mirror of
https://github.com/facebook/react.git
synced 2026-02-26 18:58:05 +00:00
10 lines
207 B
JavaScript
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;
|
|
}
|