Question 6 of 10Pro Only
What is the useEffect hook, and how do you control when it runs?
Sample answer preview
The useEffect hook lets you perform side effects in function components. Side effects include data fetching, subscriptions, manually changing the DOM, and timers. useEffect takes two arguments: a function containing the effect, and an optional dependency array.
useEffectside effectsdependency arraycleanuplifecycle