From definition
mapStateToProps
is used for selecting the part of the data from the store that the connected component needs.
I didn't understand why do we even have to specify mapStateToProps
if I can use the entire store data in my component, what exactly does mapStateToProps
provides? What will happen if I select some part of data?
Any advantages?
mapStateToProps
gives you only the parts of the store you need in the component.