我在Fluxible@0.4.10遇到了一个小错误:
Warning: Failed Context Types: Required context `getStore` was not specified in `StoreConnector`. Check the render method of `NavIndexItemTheme`.
/client-interface/node_modules/fluxible/addons/connectToStores.js:48
storeInstances[storeName] = this.context.getStore(store);
^
TypeError: undefined is not a function
事实上,我有这个:
components
|_NavIndexItemTheme.jsx
...
templates
|_tp1
|_node_modules
| |_react
|_Index.tpl.jsx
在Index.tpl.jsx 中:
import React from "react";
import NavIndexItemTheme from "../../components/NavIndexItemTheme";
export default function(props) {
return (
<div className="index">
<div className="wrapper flex fdc fas">
<h1>Hello</h1>
<NavIndexItemTheme />
</div>
</div>
);
}
如果我将node_modules文件夹删除到tp1目录,则不会出错。为什么这个目录会导致错误!!!