0
我有这样的功能:Redux - 由mapStateToProps返回的状态是商店状态的副本吗?
const mapStateToProps = function(state){
return {
products: state.products
}
};
和实体店是这样的:
var store = {
products: [1,2,3]
};
当我在所连接的组件使用this.props.products,我还需要做到这一点:
var products = this.props.products.slice();
作出副本,或者已经是副本。