Skip to content

Instantly share code, notes, and snippets.

@jsoneaday

jsoneaday/index.tsx

Created Dec 2, 2019
Embed
What would you like to do?
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter } from "react-router-dom";
import App from "./App";
import configureStore from "./shared/store/configureStore";
import registerServiceWorker from "./registerServiceWorker";
import { Provider } from "react-redux";
import ErrorBoundary from "./shared/components/ErrorBoundary";
import Modal from "react-modal";
import ApolloClient, { InMemoryCache } from "apollo-boost";
import { ApolloProvider } from "@apollo/react-hooks";
import { ApolloProvider as ApolloHooksProvider } from "react-apollo-hooks";
import "bootstrap/dist/css/bootstrap.min.css";
import "./index.scss";
const apolloClient = new ApolloClient({
uri: process.env.REACT_APP_SERVER_URL,
credentials: "include",
cache: new InMemoryCache()
});
const store = configureStore();
ReactDOM.render(
<Provider store={store}>
<BrowserRouter>
<ApolloProvider client={apolloClient}>
<ApolloHooksProvider client={apolloClient}>
<ErrorBoundary>{[<App key="App" />]}</ErrorBoundary>
</ApolloHooksProvider>
</ApolloProvider>
</BrowserRouter>
</Provider>,
document.getElementById("root") as HTMLElement
);
Modal.setAppElement("#root");
registerServiceWorker();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment