What is the `useEffect` hook in React?
react
hooks
useeffect
18
I am new to React hooks and I am trying to understand `useEffect`. When should I use it and what are common use cases? How does the dependency array work?
1 Answer
22
The `useEffect` hook in React is used for side effects in functional components. It runs after every render by default, but you can control when it runs by passing a dependency array.
answered 5h ago