Created
August 28, 2016 23:05
-
-
Save johncmckim/dce74bc5946fb4a1a85f66e2ad6da4b8 to your computer and use it in GitHub Desktop.
Garden Aid - React - Entry Point
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GRAPHQL_URL } from 'constants'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Router, browserHistory } from 'react-router'; | |
import { syncHistoryWithStore } from 'react-router-redux'; | |
import withScroll from 'scroll-behavior'; | |
import ApolloClient, { createNetworkInterface } from 'apollo-client'; | |
import { ApolloProvider } from 'react-apollo'; | |
import createAppStore from './store'; | |
import getRoutes from './routes'; | |
const networkInterface = createNetworkInterface(GRAPHQL_URL); | |
const client = new ApolloClient({ networkInterface }); | |
const scrollBrowserHistory = withScroll(browserHistory); | |
const store = createAppStore(scrollBrowserHistory, client); | |
const history = syncHistoryWithStore(scrollBrowserHistory, store); | |
ReactDOM.render( | |
<ApolloProvider store={store} client={client}> | |
<Router history={history}>{getRoutes(store)}</Router> | |
</ApolloProvider>, | |
document.getElementById('app') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment