function ComponentA(props) { const a = []; const b = []; if (b) { a.push(props.p0); } if (props.p1) { b.push(props.p2); } return ; } function ComponentB(props) { const a = []; const b = []; if (mayMutate(b)) { a.push(props.p0); } if (props.p1) { b.push(props.p2); } return ; } function Foo() {} function mayMutate() {}