React Flux (alt.js) - 不传递来自多个商店的数据
React Flux (alt.js) - not passing data from multiple stores
我似乎难以理解有关处理多个商店的文档。这是在我的APP组件中...
static getStores() {
return [InventoryStore, CompanyInfoStore];
}
static getPropsFromStores() {
return {
...InventoryStore.getState(),
...CompanyInfoStore.getState()
};
}
componentDidMount() {
const clientId = this.state.clientId;
InventoryActions.getAll(clientId);
CompanyInfoActions.getAll(clientId);
}
InventoryActions 不是 'hit' 我的 props.items 中唯一的项目是公司信息。
有人知道如何更正这个吗?
非常感谢!
我遇到了同样的问题。也许它会帮助您解决我提出的问题。我没有加入商店的属性,我对每个属性使用单独的属性。
static getPropsFromStores() {
return {
inventory: InventoryStore.getState(),
company: CompanyInfoStore.getState()
};
}
希望对您有所帮助。
我似乎难以理解有关处理多个商店的文档。这是在我的APP组件中...
static getStores() {
return [InventoryStore, CompanyInfoStore];
}
static getPropsFromStores() {
return {
...InventoryStore.getState(),
...CompanyInfoStore.getState()
};
}
componentDidMount() {
const clientId = this.state.clientId;
InventoryActions.getAll(clientId);
CompanyInfoActions.getAll(clientId);
}
InventoryActions 不是 'hit' 我的 props.items 中唯一的项目是公司信息。
有人知道如何更正这个吗?
非常感谢!
我遇到了同样的问题。也许它会帮助您解决我提出的问题。我没有加入商店的属性,我对每个属性使用单独的属性。
static getPropsFromStores() {
return {
inventory: InventoryStore.getState(),
company: CompanyInfoStore.getState()
};
}
希望对您有所帮助。