Skip to content

Instantly share code, notes, and snippets.

@hyperh
Created December 5, 2016 03:02
Show Gist options
  • Save hyperh/efc56e5b3a33db79a2daefe92b831b5a to your computer and use it in GitHub Desktop.
Save hyperh/efc56e5b3a33db79a2daefe92b831b5a to your computer and use it in GitHub Desktop.
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