1. 程式人生 > >iOS原生專案(Objective-C)整合React Native(0.57.3版本)圖文教程--(1)基本環境

iOS原生專案(Objective-C)整合React Native(0.57.3版本)圖文教程--(1)基本環境

文章目錄

iOS原生專案(Objective-C)整合React Native(0.57.3版本)圖文教程–(1)基本環境

RN官網: 搭建開發環境
https://reactnative.cn/docs/0.51/getting-started/
RN官網: iOS原生應用整合RN
https://reactnative.cn/docs/0.51/integration-with-existing-apps/

CSDN部落格: iOS原生專案整合RN0.56版本
https://blog.csdn.net/liu__000/article/details/81030881
iOS原生混合RN開發詳解
https://www.cnblogs.com/guangqiang/p/9595710.html

1. Homebrew

Homebrew: Mac 系統的包管理器,用於安裝 NodeJS

和一些其他必需的工具軟體

2. Node

Node: React Native 目前需要 NodeJS 8.0 或更高版本

#安裝
brew install node

#檢視版本號
node -v

#更新node
brew upgrade node

安裝完 node 後建議設定 npm 映象以加速後面的過程

npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global

3. Yarn

Yarn: Yarn是 Facebook 提供的替代 npm 的工具,可以加速 node 模組的下載

Yarn官方文件

brew install yarn
yarn -v
brew upgrade yarn
yarn init

安裝完 yarn 後同理也要設定映象源:

yarn config set registry https://registry.npm.taobao.org --global
yarn config set disturl https://npm.taobao.org/dist --global

安裝完 yarn 之後就可以用 yarn 代替 npm 了,例如用yarn代替npm install命令,用yarn add 某第三方庫名代替npm install --save 某第三方庫名

4. react-native-cli

react-native-cli: React Native 的命令列工具

npm install -g yarn react-native-cli

5. Watchman:

由 Facebook 提供的監視檔案系統變更的工具。

brew install watchman
watchman -v

6. Flow:

是一個靜態的 JS 型別檢查工具

brew install flow
flow version

7. Nuclide:

Facebook提供的基於atom 的整合開發環境, 可用於編寫、執行和除錯React Native 應用。

8. Xcode

做iOS開發的對此非常熟悉,非iOS開發,請到App Store下載

9. CocoaPods

做iOS開發的對此非常熟悉,非iOS開發,請百度下如何安裝

iOS 開發 cocoapad整合的問題

10. 檢視react和react-native的版本號

npm info react

在這裡插入圖片描述

npm info react-native

在這裡插入圖片描述