Skip to content

Commit 742e444

Browse files
authored
Add note about Helmet.rewind()
1 parent bf90846 commit 742e444

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tutorial/06-react-router-ssr-helmet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ import Helmet from 'react-helmet'
442442
const renderApp = (/* [...] */) => {
443443

444444
const appHtml = ReactDOMServer.renderToString(/* [...] */)
445-
const head = Helmet.rewind() // must come AFTER appHtml!
445+
const head = Helmet.rewind()
446446

447447
return (
448448
`<!doctype html>
@@ -458,7 +458,7 @@ const renderApp = (/* [...] */) => {
458458
}
459459
```
460460
461-
React Helmet uses [react-side-effect](https://github.com/gaearon/react-side-effect)'s `rewind` to pull out some data from the rendering of our app, which will soon contain some `<Helmet />` components. Those `<Helmet />` components are where we set the `title` and other `head` details for each page.
461+
React Helmet uses [react-side-effect](https://github.com/gaearon/react-side-effect)'s `rewind` to pull out some data from the rendering of our app, which will soon contain some `<Helmet />` components. Those `<Helmet />` components are where we set the `title` and other `head` details for each page. Note that `Helmet.rewind()` *must* come after `ReactDOMServer.renderToString()`.
462462
463463
- Edit `src/shared/app.jsx` like so:
464464

0 commit comments

Comments
 (0)