@Zangetsu Ichirin Good question. Thank you for pointing it out.

The useEffect Hook doesn't satisfies all conditions for a Constructor. It is run once, and only once, for the entire life-cycle of this component.

The problem is that it still runs after the component is rendered. And of course this is what we are expecting to happen since this is cleary stated in the Hooks documentation:

"By default, effects run after every completed render."

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