我在服务器上渲染反应组件,当去路由时得到错误消息:
const renderToString = ReactDOMServer.renderToString
const fac = React.createFactory(React.createClass({
render: function() {
return (
<Provider store={store}>
<StaticRouter location={location} context={routeContext}>
<App />
</StaticRouter>
</Provider>
)
}}))
const appHtml = renderToString(fac())