Now that we have a general understanding of the Effect Hook, useEffect, we’ll dive into some examples of when and how to use it. As a refresher from the previous post, useEffect is used for causing side effects in functional components. And it’s capable of handling what the componentDidMount, componentDidUpdate and componentWillUnmount lifecycle methods would normally take care of in class components.

This post will cover our first example with the useEffect Hook, showing how it can do the same thing as the lifecycle methods componentDidMount and componentDidUpdate, but in a functional component. …

Michael Rosenberg

Software Engineer/Full Stack Web Developer | Ruby, JavaScript, React, Redux

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store