Browse Source

Changed warning about SSR with missing nodes based on feedback from Sebastian

main
Brian Vaughn 7 years ago
parent
commit
8acec80c6c
  1. 2
      content/blog/2017-09-26-react-v16.0.md

2
content/blog/2017-09-26-react-v16.0.md

@ -65,7 +65,7 @@ React 16 includes a completely rewritten server renderer. It's really fast. It s
Core team member Sasha Aickin wrote a [great article describing React 16's SSR improvements](https://medium.com/@aickin/whats-new-with-server-side-rendering-in-react-16-9b0d78585d67). According to Sasha's synthetic benchmarks, server rendering in React 16 is roughly **three times faster** than React 15. "When comparing against React 15 with `process.env` compiled out, there’s about a 2.4x improvement in Node 4, about a 3x performance improvement in Node 6, and a full 3.8x improvement in the new Node 8.4 release. And if you compare against React 15 without compilation, React 16 has a full order of magnitude gain in SSR in the latest version of Node!" (As Sasha points out, please be aware that these numbers are based on synthetic benchmarks and may not reflect real-world performance.)
In addition, React 16 is better at hydrating server-rendered HTML once it reaches the client. It no longer requires the initial render to exactly match the result from the server. Instead, it will attempt to reuse as much of the existing DOM as possible. No more checksums! In general, we don't recommend that you render different content on the client versus the server, but it can be useful in some cases (e.g. timestamps). **However, it's dangerous to have missing nodes on the server render as they might get re-created with incorrect attributes.**
In addition, React 16 is better at hydrating server-rendered HTML once it reaches the client. It no longer requires the initial render to exactly match the result from the server. Instead, it will attempt to reuse as much of the existing DOM as possible. No more checksums! In general, we don't recommend that you render different content on the client versus the server, but it can be useful in some cases (e.g. timestamps). **However, it's dangerous to have missing nodes on the server render as this might cause sibling nodes to be created with incorrect attributes.**
See the [documentation for `ReactDOMServer`](/docs/react-dom-server.html) for more details.

Loading…
Cancel
Save