-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.android.js
55 lines (48 loc) · 1.27 KB
/
index.android.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, {Component} from 'react';
import {AppRegistry, StyleSheet, Text, View} from 'react-native';
class ReactNativeFirstProject extends Component{
render(){
return (
<View style={{flex: 1, alignItems : 'center'}}>
<Name styleProperty={styles.red} name='Amandeep' surname='Singh'/>
<Name styleProperty={styles.blue} name='Pritesh' surname='Nandgaonkar'/>
</View>
);
}
}
class Name extends Component{
constructor(props){
super(props);
this.name= props.name;
this.surname = props.surname;
this.state = {showTest : true};
this.styleProperty = props.styleProperty;
}
returnString = (a,b) => (a+b);
render(){
let display = 'Hello '+ this.returnString(this.name, this.surname) + '!';
return(
<Text style={this.styleProperty}>{display}</Text>
);
}
}
const styles = StyleSheet.create({
red: {
color : 'red',
backgroundColor: 'blue',
flex : 1,
},
blue: {
color : 'blue',
backgroundColor: 'red',
fontWeight : 'bold',
fontSize : 30,
flex : 10,
},
});
AppRegistry.registerComponent('ReactNativeFirstProject', () => ReactNativeFirstProject);