Skip to content

Instantly share code, notes, and snippets.

@karanjagota
Created October 23, 2020 17:31
Show Gist options
  • Save karanjagota/e40a1860af8398618e771451f30e6856 to your computer and use it in GitHub Desktop.
Save karanjagota/e40a1860af8398618e771451f30e6856 to your computer and use it in GitHub Desktop.
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
function Mycomponent(props){
return(
<Text style={styles.textstyle}>
Hello {props.addtext}
</Text>
);
}
export default function App() {
return (
<View style={styles.cv}>
<Mycomponent addtext="From 1st Prop" />
<Mycomponent addtext="From 2nd Prop" />
</View>
);
}
const styles = StyleSheet.create({ viewstyle:{ flex:1, margin:10 },
textstyle: {fontSize:18,backgroundColor: '#f50057',marginBottom: 10,color:'#ffffff',padding:10,textAlign: 'center',borderRadius:20},
cv:{
marginBottom:15
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment