Created
February 6, 2018 20:26
-
-
Save hoffination/2ce6d9c65751edafe508a35edc8b28b6 to your computer and use it in GitHub Desktop.
Server rendering with React
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
const renderApp = () => { | |
const html = renderToString(React.createFactory(App)({ welcome: 'Hello' })) | |
return ` | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Server rendered app</title> | |
</head> | |
<body>${html}</body> | |
</html> | |
` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment