在服務器上呈現我的應用程序時,我得到並且提供者元素出現Invariant錯誤。錯誤是Invariant Violation: React.Children.only expected to receive a single React element child.
我也得到這樣的警告Warning: Failed prop type: Invalid prop
孩子of type
陣列supplied to Provider, expected a single ReactElement. in Provider
這是服務器代碼還是應用程序代碼的問題?
const store = createStoreWithMiddleware(reducers);
const provider = react.createElement(Provider, { store: store }, RouterContext);
const ReactApp = renderToString(provider);
const reactRouter = require('react-router');
const RouterContext = reactRouter.RouterContext;
有毛病'RouterContext',你能告訴我們你是如何做出這個'RouterContext' –
@DavidGuan我更新我的問題與最後兩行 – joethemow