Going Isomorphic with React

#1

http://bensmithett.github.io/going-isomorphic-with-react/

还没看,对此话题很感兴趣。目前手头的项目还没实现。

我的基本思路是:在 node 里先把 dispatcher 传给 App(),看 dispatcher 里面哪些 store 被 init 了,等待 store 里面异步取的数据完成,丢弃先前的 app(因为非浏览器环境的 react 不支持改变 state,只能渲染 getInitialState 的数据),重新用这个已经有数据 init 过的 dispatcher 再 new App() 来生成静态网页。dispatcher 里面的数据也连同 HTML 给到前端,之后就是前端的事了。