Skip to content

Instantly share code, notes, and snippets.

@rocksinghajay
Created November 29, 2018 18:13
Show Gist options
  • Select an option

  • Save rocksinghajay/a93268bc336dfcd1ca7ac27ed870e405 to your computer and use it in GitHub Desktop.

Select an option

Save rocksinghajay/a93268bc336dfcd1ca7ac27ed870e405 to your computer and use it in GitHub Desktop.
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
import SplashScreen from 'react-native-splash-screen';
const instructions = Platform.select({
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
android:
'Double tap R on your keyboard to reload,\n' +
'Shake or press menu button for dev menu',
});
type Props = {};
export default class App extends Component<Props> {
componentDidMount() {
SplashScreen.hide()
}
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to React Native!</Text>
<Text style={styles.instructions}>To get started, edit App.js</Text>
<Text style={styles.instructions}>{instructions}</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'darkred',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
color: '#fff'
},
instructions: {
textAlign: 'center',
color: '#fff',
marginBottom: 5,
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment