Skip to content

Instantly share code, notes, and snippets.

@jasurkurbanov
Last active July 22, 2020 04:25
Show Gist options
  • Save jasurkurbanov/402fb125c969974eff32a0dcbc0df170 to your computer and use it in GitHub Desktop.
Save jasurkurbanov/402fb125c969974eff32a0dcbc0df170 to your computer and use it in GitHub Desktop.
For Custom Text Component Tutorial
import * as React from 'react';
import { Text, View, StyleSheet } from 'react-native';
export default function App() {
return (
<View style={styles.container}>
<Text style={styles.h1}>Heading 1</Text>
<Text style={styles.h2}>Heading 2</Text>
<Text style={styles.h3}>Heading 3</Text>
<Text style={styles.h4}>Heading 4</Text>
<Text style={styles.h5}>Heading 5</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
},
h1: {
fontSize: 20
},
h2: {
fontSize: 18
},
h3: {
fontSize: 16
},
h4: {
fontSize: 14
},
h5: {
fontSize: 12
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment