-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Expand on recommended hydrate() usage #200
Conversation
Deploy preview ready! Built with commit fb2f81b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really nice change 👍
content/docs/reference-react-dom.md
Outdated
Same as [`render()`](#render), but is used to hydrate a container whose HTML contents were rendered by [`ReactDOMServer`](/docs/react-dom-server.html). React will attach event listeners while preserving as much of the existing DOM as possible. For best results, you should try to render the same content on the server as on the client, with as few differences as possible. | ||
Same as [`render()`](#render), but is used to hydrate a container whose HTML contents were rendered by [`ReactDOMServer`](/docs/react-dom-server.html). React will attempt to attach event listeners to the existing markup. | ||
|
||
React expects that the rendered content is identical between the server and the client. It can patch up differences in text content (such as timestamps), but you should treat mismatches as bugs and fix them. React reports any mismatches as warnings during hydration in development. There are no guarantees that attribute differences will be patched up in case of mismatches. This is important for performance reasons because in most apps, mismatches are rare, and so validating all markup would be prohibitively expensive. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
Maybe change:
React reports any mismatches as warnings during hydration in development.
To:
In development mode, React warns about mismatches during hydration.
Tweaked a bit, mind looking again? |
Why not? They pay me to do this. 😁 |
I think the new paragraph is nice too. 👍 |
* translate of react blog post react v15.6.2 * Update content/blog/2017-09-25-react-v15.6.2.md Co-Authored-By: netochaves <[email protected]>
docs(cn): fix link in content/docs/reference-react-component.md
Partly addresses #25.
See yet another thread: facebook/react#11336.