【发布时间】:2015-07-05 06:22:06
【问题描述】:
在这篇文章Mixins Are Dead. Long Live Composition 之后,我设置了一个 Pet 组件来监听宠物,并且所有者为用户存储了一个更高阶的组件。但是如何将宠物资源中的 owner_id 传递给connectToStores?这仅仅是mixins优越的一个例子吗?
Pet = connectToStores(Pet, [PetStore, OwnerStore], (props) => {
return {
pet : PetStore.getOne(props.id),
owner : OwnerStore.getOne(ownerId), // this should come from pet.owner_id
};
});
【问题讨论】:
标签: reactjs reactjs-flux flux