Skip to content

Instantly share code, notes, and snippets.

@redbluenat
Created December 6, 2018 19:21
Show Gist options
  • Save redbluenat/fe8577202f7aa634f35234ab831cde53 to your computer and use it in GitHub Desktop.
Save redbluenat/fe8577202f7aa634f35234ab831cde53 to your computer and use it in GitHub Desktop.
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