Closed DarkPage closed 7 years ago
I use koa2 and koa-ejs to make a react ssr demo koa code:
const markup = renderToString( <Provider store={store()} > <RouterContext { ...props } /> </Provider> ); await ctx.render('index', { markup });
chrome devtool look like this:
<html> <head> <title>koa2 webpack2 react ssr</title> </head> <body> <div id="root"><div data-reactroot="" data-reactid="1" data-react-checksum="-1292022691"><h4 data-reactid="2">This is React App Component</h4><a href="/a" data-reactid="3">A</a><a href="/b" data-reactid="4">B</a><a href="/c" data-reactid="5">C</a><div data-reactid="6">This is B</div></div></div> <script src="./bundle.js"></script> </body> </html>
why?
It's my mistake, i change my template <%= obj &> to <%- obj &> T_T
I use koa2 and koa-ejs to make a react ssr demo koa code:
chrome devtool look like this:
why?