React Native学习(三)---完成Hello World教程

官方教程

React Native 中文网

阮一峰的ECMAScript 6 入门

将工程中app.js修改为如下保存,用xcode 打开工程跑起来了

import React, { Component } from 'react';
import {
  Platform,
  StyleSheet,
  Text,
  View
} from 'react-native';

const instructions = Platform.select({
  ios: 'Hello World iOS',
  android: 'Hello World android',
});

type Props = {};
export default class App extends Component {
  render() {
    return (
      
        
          {instructions}
        
      
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});

你可能感兴趣的:(React Native学习(三)---完成Hello World教程)