import React, { Component } from 'react'
import {
AppRegistry,
StyleSheet,
Text,
View,
} from 'react-native'
class Good extends Component {
render() {
return (<Text style={styles.welcome}>hellow word</Text>)
}
}
const Nood=()=>{
return(<Text style={styles.welcome}>hellow color</Text>)
}
class App extends Component {
render() {
return (
<View style={styles.container}>
<Good />
<Nood />
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
color:'#0066ff'
},
})
import {
AppRegistry,
StyleSheet,
Text,
View,
} from 'react-native'
class Good extends Component {
render() {
return (<Text style={styles.welcome}>hellow word</Text>)
}
}
const Nood=()=>{
return(<Text style={styles.welcome}>hellow color</Text>)
}
class App extends Component {
render() {
return (
<View style={styles.container}>
<Good />
<Nood />
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
color:'#0066ff'
},
})
AppRegistry.registerComponent('App', () => App)
React Native参考