app.get('/',function(req, res, next){

let preloadState = {
text : 'Server-Side Rendering'
};

let renderProps = {
preloadState: `window.__PRELOADED_STATE__ =${JSON.stringify(preloadState).replace(/</g, '\\u003c')}`,
script: 'http://localhost:3000/build/client.bundle.js',
appComponent: ReactDOMServer.renderToString(<App data={preloadState}/>)
};

const html = ReactDOMServer.renderToStaticMarkup(<Html {...renderProps}/>); // server-side Rendering

res.send(`<!doctype html>${html}`);
});



출처: http://dev-momo.tistory.com/entry/React-Server-Side-Rendering [Programming Note]



위에는 그냥 긁어온 거구여. 


1. renderToString이랑 renderToStaticMarkup이 state tree 같은 거 알아서 타고 들어가면서 재귀적으로 html 다 그려주는 거에영?

2. 서버사이드 렌더링 하는게 존나 현실적으로 SEO때문에 하는건가여 아님 진짜 존나 빠른가여?