Reactjs React renderToString没有数据React校验和 //renderToString 试一试{ initView=renderToString( {renderRoutes(routes)} ); console.log('lzr===='); console.log(initView); console.log('lzr===='); }
运行此命令后,获取initView,如下所示:Reactjs React renderToString没有数据React校验和 //renderToString 试一试{ initView=renderToString( {renderRoutes(routes)} ); console.log('lzr===='); console.log(initView); console.log('lzr===='); },reactjs,checksum,server-side-rendering,render-to-string,Reactjs,Checksum,Server Side Rendering,Render To String,运行此命令后,获取initView,如下所示: // renderToString try { initView = renderToString( <Provider store={store}> <StaticRouter location={location} context={context}> {renderRoutes(routes)} </S
// renderToString
try {
initView = renderToString(
<Provider store={store}>
<StaticRouter location={location} context={context}>
{renderRoutes(routes)}
</StaticRouter>
</Provider>
);
console.log('lzr======');
console.log(initView);
console.log('lzr======');
}
some thing- 。。。。
我做了initView.indexOf('check')并得到-1。谁能帮我一个忙吗,谢谢。我发现这个删除了data react ID和data react校验和
<div data-reactroot=""><div></div><div><div class="common-side-bar"><a href="/"><div class="bar-top"></div></a><div class="pandect"><span class="icon-pandest"></span>some thing</div><div class="menu"><ul style="width:180px" class="ant-menu ant-menu-inline ant-menu-dark ant-menu-root" role="menu" aria-activedescendant="" tabindex="0"><li class="ant-menu-submenu-inline ant-menu-submenu"><div style="padding-left:24px" class="ant-menu-submenu-title" aria-expanded="false" aria-owns="iot$Menu" aria-haspopup="true"><span><i class="icon-iothub common-icon">....