React Native

来源:互联网 发布:如何自学程序员 编辑:程序博客网 时间:2024/05/18 19:39
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'
  },
})


AppRegistry.registerComponent('App', () => App)


React Native参考

原创粉丝点击