Skip to content

Commit

Permalink
ServerRendering docs: remove ref to data-react-id (#3322)
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas authored and timdorr committed Jan 2, 2019
1 parent 6b7283f commit 83a978d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/recipes/ServerRendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ hydrate(

You can set up your build tool of choice (Webpack, Browserify, etc.) to compile a bundle file into `static/bundle.js`.

When the page loads, the bundle file will be started up and [`ReactDOM.hydrate()`](https://reactjs.org/docs/react-dom.html#hydrate) will hook into the `data-react-id` attributes from the server-rendered HTML. This will connect our newly-started React instance to the virtual DOM used on the server. Since we have the same initial state for our Redux store and used the same code for all our view components, the result will be the same real DOM.
When the page loads, the bundle file will be started up and [`ReactDOM.hydrate()`](https://reactjs.org/docs/react-dom.html#hydrate) will reuse the server-rendered HTML. This will connect our newly-started React instance to the virtual DOM used on the server. Since we have the same initial state for our Redux store and used the same code for all our view components, the result will be the same real DOM.

And that's it! That is all we need to do to implement server side rendering.

Expand Down

0 comments on commit 83a978d

Please sign in to comment.