Created
December 5, 2016 03:02
-
-
Save hyperh/efc56e5b3a33db79a2daefe92b831b5a to your computer and use it in GitHub Desktop.
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
import React from 'react'; | |
import { renderToString } from 'react-dom/server'; | |
import template from './template'; | |
import App from './components/App'; | |
export default function render(req, res) { | |
const appString = renderToString(<App />); | |
res.send(template({ | |
body: appString, | |
title: 'FROM THE SERVER', | |
})); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment