react-native学习笔记一

2021-11-08 09:58:50 浏览数 (1)

react-native基本结构

代码语言:javascript复制
import React,{ Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';

export default class myapp extends Component {
//输出默认样式继承Component
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>
          Welcome to React Native!
        </Text>
        <Text style={styles.instructions}>
          To get started, edit index.android.js
        </Text>
        <Text style={styles.instructions}>
          Double tap R on your keyboard to reload,{'n'}
          Shake or press menu button for dev menu
        </Text>
      </View>
    );
  }
}

0 人点赞