【IOS】React Native之HelloWorld

RN搭建开发环境
rvm 安装3.2.2

复制代码
brew install node@18
brew install watchman

# 使用nrm工具切换淘宝源
npx nrm use taobao

# 如果之后需要切换回官方源可使用
npx nrm use npm

npm install -g yarn

brew install cocoapods

npm uninstall -g react-native-cli @react-native-community/cli

 npx react-native@latest init AwesomeProject

cd AwesomeProjectcd

# 如果没有node_modules文件夹 
npm install

cd ios

pod install

因为rn生成的项目总是会报glog的错误,所以需要使用glog源代码覆盖项目Pods中的glog文件夹

glog源代码下载,用于覆盖项目中的glog

如果还会报 Command PhaseScriptExecution failed with a nonzero exit code 就勾选这个

No bundle URL present

要在根index.js目录下运行

复制代码
npm start
相关推荐
软弹5 小时前
深入理解 React Ref 机制:useRef 与 forwardRef 的协作原理
前端·javascript·react.js
前端炒粉5 小时前
React 面试高频题
前端·react.js·面试
少云清5 小时前
IOS历史版本下载
ios
张一凡935 小时前
React 项目也能用依赖注入?我尝试了一下,真香
前端·react.js
Csvn6 小时前
Redux Toolkit 实战
react.js
snow_yan6 小时前
基于 json-render 的流式表单渲染方案
前端·react.js·llm
Csvn6 小时前
组件设计模式(下):HOC、Render Props 与 Compound Components
react.js
用户2814512549927 小时前
迷你React手写系列-React基本概念
react.js
im_AMBER8 小时前
万字长文:编辑器集成Vercel AI SDK
前端·人工智能·react.js·前端框架·编辑器
大雷神8 小时前
HarmonyOS APP<玩转React>开源教程二十:收藏功能实现
前端·react.js·开源·harmonyos