verekia / js-stack-from-scratch

🛠️⚡ Step-by-step tutorial to build a modern JavaScript stack.
MIT License
20.05k stars 1.99k forks source link

Line with initStore dropped in Helmet section #188

Closed crcdng closed 7 years ago

crcdng commented 7 years ago

Type of issue: (feature suggestion, bug?)

error in the instruction

Chapter:

06 React Helmet

If it's a bug:

In the instruction to edit src/server/render-app.jsx,

import Helmet from 'react-helmet'
// [...]
const renderApp = (/* [...] */) => {

  const appHtml = ReactDOMServer.renderToString(/* [...] */)
  const head = Helmet.rewind()

  return (
    `<!doctype html>
    <html>
      <head>
        ${head.title}
        ${head.meta}
        <link rel="stylesheet" href="${STATIC_PATH}/css/style.css">
      </head>
    [...]
    `
  )
}

the line const store = initStore(plainPartialState) is missing before the line const appHtml = ReactDOMServer.renderToString(/* [...] */).

verekia commented 7 years ago

You're right, the code is missing a [...]. That's confusing.

verekia commented 7 years ago

Fixed.