When using `useEffect` in React, under what specific circumstance will the effect function execute only once upon component mounting, and never re-execute thereafter?
The `useEffect` hook in React executes an effect function based on its dependency array. When the dependency array is empty (`[]`), the effect function will execute *only once*, after the component's initial render (mounting), and never re-execute on subsequent renders. This is because the empty dependency array signals to React that the effect does not depend on any values within the component's scope. Therefore, React assumes the effect only needs to run once, when the component is first added to the DOM. This is useful for effects that perform setup actions, such as setting up event listeners or fetching data, that should only happen once throughout the component's lifecycle. If any values were included in the dependency array, the effect would re-run whenever any of those dependencies change. By providing an empty array, the effect essentially mimics the behavior of `componentDidMount` in class components, executing only after the initial render.