useEffect Hook
In this episode we are going to take a look at an useEffect Hook for React and how it approximates to some lifecycle methods.
In the previous episode we learned about lifecycle methods in Reacts class components. Since we can’t use those methods in functional components, we have to use React Hooks. And one hook that is going to give us similar effects to lifecycle hooks is useEffect
.
However, you will hear me repeat several times in the video that useEffect
is not the same thing as something like componentDidMount
. And that is why I urge you to read an article by Dan Abramov called “A Complete Guide To useEffect” talking about useEffect
in much more depth. Go, read it!