新建项目
npx react-native init app
安装依赖
包括以下内容:
-
react navigation
基础模块
stack
bottom-tabs
- 刘海屏安全区域
- 对手势的支持
- 图标库
- storage 存储
cd app
yarn add @react-navigation/native react-native-screens react-native-safe-area-context @react-navigation/native-stack @react-navigation/bottom-tabs react-native-vector-icons @react-native-async-storage/async-storage
修改index.js
import { AppRegistry } from 'react-native';
import App from './App';
...