1. npx create-expo-app --template blank
  2. 进入目录,然后 npx expo start,根据提示启动iOS或安卓模拟器
  3. 打开:https://docs.expo.dev/router/installation/#manual-installation 安装依赖

npx expo install expo-router react-native-safe-area-context react-native-screens expo-linking expo-constants expo-status-bar

  1. 设置启动页

进入package.json,将 "main": "expo/AppEntry.js", 替换成 "main": "expo-router/entry",

  1. 添加scheme

进入app.json,在ios下面添加 "scheme": "your-app-scheme" ,值修改成自己想要的

  1. 根目录添加app文件夹和index.js文件,index.js文件默认export
  2. 重启npx expo start
最后编辑:2024年09月29日 ©著作权归作者所有

发表评论