React Component Lifecycle
Consts of 3 phases:
Phase 1: The mounting phase is when a new component is created and inserted into the DOM or, in other words, when the life of a component begins. This can only happen once, and is often called “initial render.”
Phase 2: The updating phase is when the component updates or re-renders. This reaction is triggered when the props are updated or when the “state” is updated. This phase can occur multiple times, which is kind of the point of React.
Phase 3: The last phase within a component’s lifecycle is the unmounting phase, when the component is removed from the DOM.