Skip to content

Instantly share code, notes, and snippets.

@SaraVieira
Created June 4, 2018 17:05
Show Gist options
  • Save SaraVieira/719a9fed74a067019a7d197aa9eab0b1 to your computer and use it in GitHub Desktop.
Save SaraVieira/719a9fed74a067019a7d197aa9eab0b1 to your computer and use it in GitHub Desktop.
import { StaticRouter } from 'react-router'
...
const context = {}
const Root = () => (
<StaticRouter location={req.url} context={context}>
<App />
</StaticRouter>
)
const markup = renderToString(<Root />);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment