Skip to content

Instantly share code, notes, and snippets.

@felippepuhle
Created November 4, 2018 19:20
Show Gist options
  • Save felippepuhle/616e5b56c4b7838e96ab4b97d8e90728 to your computer and use it in GitHub Desktop.
Save felippepuhle/616e5b56c4b7838e96ab4b97d8e90728 to your computer and use it in GitHub Desktop.
import { ReleasyProvider, Config, Link, renderToStringWithData } from 'react-releasy';
const config = new Config({
link: new Link({
url: 'https://yourserveraddress.com/graphql',
}),
});
const Application = (
<ReleasyProvider config={config}>
<App />
</ReleasyProvider>
);
const root = document.getElementById('root');
if (root.hasChildNodes() === true) {
ReactDOM.hydrate(Application, root);
} else {
ReactDOM.render(Application, root);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment