const Component1 = () => { useEffect() as []; }; const Component2 = () => { if (a == 1) { Component1(); } };