带有 Alt (Flux) 的多个商店

Multiple stores with Alt (Flux)

主要 Alt page 上的示例展示了如何使用 @connectToStores 将单个商店连接到 React 组件。

我想知道我们是否仍然可以使用 @connectToStores 将 2 个商店连接到一个 React 组件。我想 getStores 方法应该是这样的:

static getStores() {
  return [TodoStore, TodoStore2];
}

但我不知道 getPropsFromStores 应该如何。

这里回答了这个问题

https://github.com/goatslacker/alt/issues/420

如果您想为一个组件将 2 个商店连接在一起,请将您的组件包装在 AltContainer and then reference the props the AltContainer 传递给您的组件。