【发布时间】:2019-04-02 09:03:39
【问题描述】:
当我访问/m/song时,htmlstring只包含Layouts组件
htmlstring = renderToString(
<Provider store={store}>
<StaticRouter location={ctx.url} context={context}>
{renderRoutes(routesConfig)}
</StaticRouter>
</Provider>
);
const routesConfig = [{
component: Layouts,
routes:[{path: '/m/song', componentName: 'Song', component: Song}]
…
htmlstring 应该包含 Layouts 和 Song 组件。
【问题讨论】:
标签: reactjs react-router react-router-v4 server-rendering