Reading notes about code for my future reference.
The useEffect method is used as hook to serve as a way to apply lifecycle methods.
It allows you to use state and other react features without having to utilize react features without writing class.
After rendering finishes, useEffect will check the list of dependency values against the values from the last render, and will call your effect function if any one of them has changed.
It allows us to access the count state variable from the effect.