Skip to content

Instantly share code, notes, and snippets.

@jschr
Created April 11, 2017 22:28
Show Gist options
  • Save jschr/5af8bae57651525ef123251e65e3bdce to your computer and use it in GitHub Desktop.
Save jschr/5af8bae57651525ef123251e65e3bdce to your computer and use it in GitHub Desktop.
Basic template step 1
export default function Template({ body, ssr, js }) {
return (
<html>
<head>
<title>{ssr.appProps.username}</title>
</head>
<body>
<div id='react-root' dangerouslySetInnerHTML={{ __html: body }} />
<script dangerouslySetInnerHTML={{ __html: `window.ssr = ${JSON.stringify(ssr)}` }} />
{ js.map(src => <script src={src} />) }
</body>
</html>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment