Skip to content

Instantly share code, notes, and snippets.

@b-tiwari
Last active April 15, 2018 03:36
Show Gist options
  • Save b-tiwari/51f8e55f2ca24267e4dfbb7da88ebc3e to your computer and use it in GitHub Desktop.
Save b-tiwari/51f8e55f2ca24267e4dfbb7da88ebc3e to your computer and use it in GitHub Desktop.
App.tsx using Header
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import Header from './components/header/header';
export default class App extends React.Component {
render() {
const { container, header, content } = styles;
return (
<View style={container}>
<View style={header}>
<Header title="Awesomest App Ever!!!" />
</View>
<View style={content}>
<Text>Open up App.js to start working on your app!</Text>
<Text>Changes you make will automatically reload.</Text>
<Text>Shake your phone to open the developer menu.</Text>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#eee',
justifyContent: 'center'
},
header: {
flex: 1
},
content: {
flex: 6,
alignItems: 'center',
justifyContent: 'center'
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment