3.2 Lifecycle Events With the `useEffect` Hook
In addition to the
useState hook, another very common hook is the
useEffect hook. The
useEffect hook is used to tie into the lifecycle events of components and execute functionality when these events occur. But be careful! I'll show you a common trap you might fall into.