react-native demo 开发环境

expo go官网:

https://expo.dev/

安装脚手架:

yarn global add expo-cli

创建项目并启动:

expo init my-app

cd my-app

yarn start

expo 开发者工具:

 手机下载调试软件:

保证手机和电脑在同一个局域网中用苹果手机的照相机扫描expo开发者工具中的二维码即可:

 代码:

 

在电脑安装安卓模拟调试:

android-studio下载并安装:

https://android-studio.en.softonic.com/

下载:android-sdk_r24.4.1-windows.zip

 

App.js:

import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';

export default function App() {
  return (
    <View style={styles.container}>
      <Text style={{color: "red", fontSize: 50}}>hello,world!</Text>
      <StatusBar style="auto" />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

posted @ 2022-01-26 16:16  徐同保  阅读(1)  评论(0编辑  收藏  举报  来源