Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const htmlTemplate = (reactHTML = '', initialState = {}) => (
- `<!doctype html>
- <html lang="en-us">
- <head>
- <script type="text/javascript">
- window.__initialState__ = ${JSON.stringify(transit.toJSON(initialState))} // let the client know the server-side state
- </script>
- </head>
- <body>
- <script src="client.bundle.js" async></script> // include the client bundle
- <div id="react-root">${reactHTML}</div> // use the server rendered markup
- </body>
- </html>`
- )
Add Comment
Please, Sign In to add comment