useEffect
The useEffect hook is a feature in React that allows developers to perform side effects in functional components. Side effects can include data fetching, subscriptions, or manually changing the DOM. It runs after the component renders, ensuring that the UI is updated before executing the effect.
You can control when useEffect runs by providing a dependency array as a second argument. If the array is empty, the effect runs only once after the initial render. If it contains variables, the effect will re-run whenever those variables change, allowing for dynamic updates based on state or props.