Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React 服务端渲染 #61

Open
hsipeng opened this issue Aug 3, 2018 · 0 comments
Open

React 服务端渲染 #61

hsipeng opened this issue Aug 3, 2018 · 0 comments
Labels

Comments

@hsipeng
Copy link
Owner

hsipeng commented Aug 3, 2018

React 服务端渲染

环境

  • React 16
  • React-router V4
  • Koa2

原理

react-dom/server 中提供的 renderToString 方法,可以将页面在服务端渲染出来。

当然前后端需要公用一个store 保证渲染一致性

@hsipeng hsipeng added react react ssr labels Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant