Guest User

Untitled

a guest
Jul 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. const htmlTemplate = (reactHTML = '', initialState = {}) => (
  2. `<!doctype html>
  3. <html lang="en-us">
  4. <head>
  5. <script type="text/javascript">
  6. window.__initialState__ = ${JSON.stringify(transit.toJSON(initialState))} // let the client know the server-side state
  7. </script>
  8. </head>
  9. <body>
  10. <script src="client.bundle.js" async></script> // include the client bundle
  11. <div id="react-root">${reactHTML}</div> // use the server rendered markup
  12. </body>
  13. </html>`
  14. )
Add Comment
Please, Sign In to add comment