-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (21 loc) · 741 Bytes
/
index.js
File metadata and controls
27 lines (21 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React from "react";
import { registerRootComponent } from "expo";
import { API_URL, API_TOKEN } from "@env";
import App from "./App";
import { ApolloClient, InMemoryCache, ApolloProvider } from "@apollo/client";
const client = new ApolloClient({
uri: API_URL,
cache: new InMemoryCache(),
headers: {
authorization: `Bearer ${API_TOKEN}`,
},
});
const RootComponent = () => (
<ApolloProvider client={client}>
<App />
</ApolloProvider>
);
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in the Expo client or in a native build,
// the environment is set up appropriately
registerRootComponent(RootComponent);