Created
December 6, 2018 19:21
-
-
Save redbluenat/fe8577202f7aa634f35234ab831cde53 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 React, { Component } from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
import { ApolloClient, HttpLink, InMemoryCache } from 'apollo-boost'; | |
import { ApolloProvider } from 'react-apollo'; | |
const client = new ApolloClient({ | |
link: new HttpLink(), | |
cache: new InMemoryCache() | |
}); | |
export default class App extends Component { | |
render() { | |
return ( | |
<ApolloProvider client={client}> | |
<View style={styles.container}> | |
<Text style={styles.welcome}>Welcome to React Native!</Text> | |
<Text style={styles.instructions}>To get started, edit App.js</Text> | |
</View> | |
</ApolloProvider> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center', | |
backgroundColor: '#F5FCFF' | |
}, | |
welcome: { | |
fontSize: 20, | |
textAlign: 'center', | |
margin: 10 | |
}, | |
instructions: { | |
textAlign: 'center', | |
color: '#333333', | |
marginBottom: 5 | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment