Skip to content

docs: ReactDOMServer #80

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

Merged
merged 7 commits into from
Jul 14, 2019
Merged

docs: ReactDOMServer #80

merged 7 commits into from
Jul 14, 2019

Conversation

chloewlin
Copy link
Member

@chloewlin chloewlin commented Jul 7, 2019

  • renderToString()
  • renderToStaticMarkup()
  • renderToNodeStream()
  • renderToStaticNodeStream()

@netlify
Copy link

netlify bot commented Jul 7, 2019

Deploy preview for zh-hant-reactjs-org ready!

Built with commit ea88de3

https://deploy-preview-80--zh-hant-reactjs-org.netlify.com

Copy link
Member Author

@chloewlin chloewlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is ready for review. Please see my notes.

@chloewlin chloewlin changed the title Set up ReactDOMServer branch [doc] ReactDOMServer Jul 7, 2019
@chloewlin chloewlin changed the title [doc] ReactDOMServer docs: ReactDOMServer Jul 7, 2019

If you call [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on a node that already has this server-rendered markup, React will preserve it and only attach event handlers, allowing you to have a very performant first-load experience.
如果你在一個已經有伺服器端 render 標記的 node 上呼叫 [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate),React 將會保留這個 node 並只附上事件處理,這使你能有一個高效能的初次下載體驗。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
如果你在一個已經有伺服器端 render 標記的 node 上呼叫 [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate),React 將會保留這個 node 並只附上事件處理,這使你能有一個高效能的初次下載體驗
如果你在一個已經有伺服器端 render markup 的 node 上呼叫 [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate),React 將會保留這個 node 並只附上事件處理,這讓你能有一個高效能的初次載入體驗


If you plan to use React on the client to make the markup interactive, do not use this method. Instead, use [`renderToString`](#rendertostring) on the server and [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on the client.
如果你打算在前端使用 React 以使得標記有互動性的話,請不要使用這個方法。請在伺服器端使用 [`renderToString`](#rendertostring) 並在前端使用 [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
如果你打算在前端使用 React 以使得標記有互動性的話,請不要使用這個方法。請在伺服器端使用 [`renderToString`](#rendertostring) 並在前端使用 [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate)
如果你打算在前端使用 React 以使得 markup 有互動性的話,請不要使用這個方法。請在伺服器端使用 [`renderToString`](#rendertostring)並在前端使用 [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate)

@chloewlin
Copy link
Member Author

Hi @neighborhood999, thanks for your review! I've made all of the requested changes. Please take a look again and we can merge this in. :)

@chloewlin chloewlin added Revisions Made Made revisions after review In Review Currently under review Completed and removed Revision Needed In Review Currently under review Revisions Made Made revisions after review labels Jul 12, 2019
@chloewlin chloewlin merged commit 9fbd3fd into reactjs:master Jul 14, 2019
@chloewlin chloewlin deleted the react-dom-server branch July 14, 2019 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants