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 p arts of the store you need in the component.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.