Created
March 8, 2018 07:10
-
-
Save xiaoyunyang/6e7870e2696f97dd2e7bea93c624763c to your computer and use it in GitHub Desktop.
isomorphic-router-demo/shared/components/HTML.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// shared/components/HTML.js | |
import React from 'react'; | |
const HTML = (props) => ( | |
<html lang="en"> | |
<head> | |
<title>Isomorphic Router Demo</title> | |
<link | |
rel="stylesheet" | |
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css" | |
/> | |
</head> | |
<body> | |
<div | |
id="root" | |
dangerouslySetInnerHTML={{ __html: props.html }} | |
/> | |
<script dangerouslySetInnerHTML={{ | |
__html: | |
`window.__SERIALIZED_STATE__ = | |
JSON.stringify(${props.serverState})` | |
}} | |
/> | |
<script type="application/javascript" src="/main.bundle.js" /> | |
</body> | |
</html> | |
); | |
export default HTML; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment