Life cycle of a class based component when connecting to the store
Jun 7, 2021
Instructor: Dakota Lee Martinez
Connect is a higher order component, a parent that wrapping the class component, that passes two functions along, MapStateToProps() and MapDispatchToProps(). The main purpose of this to function, is to add the props in to class based component that is wrapped by connect.

- MapStateToProps() and MapDispatchToProps() are called before componentDidMount. The data returned from those two functions are the props from the store returned when the first render is happening.
- ComponentDidMount is next after the first render, it dispatch an action creator, fetching the API, and then we use the THUNK to add a new dispatch storing the data in the store, and notify all the subscribed components. MapStateToProps() will be called again, to pass the props in the component, whenever a component receives new props it will re-render.