Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import { renderToStringWithData } from "react-apollo"
const client = new ApolloClient(...);
renderToStringWithData(App).then((content) => {
const initialState = client.extract();
const html = <Html content={content} state={initialState} />;
res.send(`<!doctype html>\n${ReactDOM.renderToStaticMarkup(html)}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.