Skip to content

Instantly share code, notes, and snippets.

@jasurkurbanov
Created July 22, 2020 07:32
Show Gist options
  • Save jasurkurbanov/c739871aa4cf168dc5b5af979b8b4570 to your computer and use it in GitHub Desktop.
Save jasurkurbanov/c739871aa4cf168dc5b5af979b8b4570 to your computer and use it in GitHub Desktop.
Custom Text Component Tutorial
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { MyText } from './src/components/MyText'
export default function App() {
return (
<View style={styles.container}>
<MyText title={'Header 1'} h1/>
<MyText title={'Header 1'} h2/>
<MyText title={'Header 1'} h3/>
<MyText title={'Header 1'} h4/>
<MyText title={'Header 1'} h5/>
<MyText title={'Header 1'} p/>
<MyText title={'Header 1'} h1 bold/>
<MyText title={'Header 1'} h2 bold/>
<MyText title={'Header 1'} h3 bold/>
<MyText title={'Header 1'} h4 bold/>
<MyText title={'Header 1'} h5 bold/>
<MyText title={'Header 1'} p bold/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment