mirror of
https://github.com/facebook/react.git
synced 2026-02-26 07:05:09 +00:00
27 lines
403 B
JavaScript
27 lines
403 B
JavaScript
function ComponentA(props) {
|
|
const a = [];
|
|
const b = [];
|
|
if (b) {
|
|
a.push(props.p0);
|
|
}
|
|
if (props.p1) {
|
|
b.push(props.p2);
|
|
}
|
|
return <Foo a={a} b={b} />;
|
|
}
|
|
|
|
function ComponentB(props) {
|
|
const a = [];
|
|
const b = [];
|
|
if (mayMutate(b)) {
|
|
a.push(props.p0);
|
|
}
|
|
if (props.p1) {
|
|
b.push(props.p2);
|
|
}
|
|
return <Foo a={a} b={b} />;
|
|
}
|
|
|
|
function Foo() {}
|
|
function mayMutate() {}
|