Skip to content

Instantly share code, notes, and snippets.

@takanorip
Created December 10, 2018 03:21
Show Gist options
  • Save takanorip/cceb5bf9c03a3452696a6300d7debed2 to your computer and use it in GitHub Desktop.
Save takanorip/cceb5bf9c03a3452696a6300d7debed2 to your computer and use it in GitHub Desktop.
const Html = ({ content, state }) => (
<html>
<body>
<div id="root" dangerouslySetInnerHTML={{ __html: content }} />
<script dangerouslySetInnerHTML={{
__html: `window.__APOLLO_STATE__=${JSON.stringify(state).replace(/</g, '\\u003c')};`,
}} />
</body>
</html>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment