Skip to content

Instantly share code, notes, and snippets.

@ghankerson
Created May 30, 2019 21:37
Show Gist options
  • Save ghankerson/edc2be0b853dd1996c588cc7e43fc588 to your computer and use it in GitHub Desktop.
Save ghankerson/edc2be0b853dd1996c588cc7e43fc588 to your computer and use it in GitHub Desktop.
import App from '../shared/App';
import React from 'react';
import { hydrate } from 'react-dom';
import { ApolloProvider } from 'react-apollo';
import { HelmetProvider } from 'react-helmet-async';
import { client } from '../shared/graphql/graphqlClient';
import '@babel/polyfill';
const graphqlEnv = window.location.href.match(/local|dev/) ? '-dev' : '';
const graphqlClient = client(graphqlEnv);
const Wrapped = () => {
const helmetContext = {};
return (
<HelmetProvider context={helmetContext}>
<ApolloProvider client={graphqlClient}>
<App />
</ApolloProvider>
</HelmetProvider>
);
};
hydrate(<Wrapped />, document.getElementById('root'));
if (module.hot) {
module.hot.accept();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment