12. useEffect() - florypaul/ReactJS GitHub Wiki
useEffect hook calls a function after page renders for the first time and it is called every time a state is changed. By using this Hook, you tell React that your component needs to do something after render. React will remember the function you passed (we'll refer to it as our “effect”), and call it later after performing the DOM updates.
Example - user input validation
changing title of the page document.title
In a Shopping cart site, when an item is added to the cart then the shopping cart icon to the right pops up.. css effect