function useFreeze() {} function foo() {} function Component(props) { const x = []; const y = useFreeze(x); foo(y, x); return ( {x} {y} ); }