Featured Articles
React Native Introduction: Building IOS Apps with JavaScript (1)
React Native Introduction: Building IOS Apps with JavaScript (2)
React Native Introductory example Tutorial series articles
React native Component Development series articles
React Native Environment Building-Mac Edition
1. Installing homebrew
Use Brew-v to see if it has been installed;
If not, the browser accesses the http://brew.sh/installation
2. Install node
Use Node-v to see if it has been installed
installation command:
Install node
3. Installing Watchman
installation command:
Install Watchman
Watchman is a Facebook file monitor, React Native uses it to detect code changes in order to recompile
4. Install flow
installation command:
Install Flow
Flow is a tool for detecting JS syntax
5. Install React Native via NPM
installation command:
Install -G react-native-cli
NPM is node's package Manager, equivalent to iOS cocoapods or Java maven
6. Create HelloWorld Example
Under terminal, switch to the folder where you want to save the project, and then run:
$ react-native init HelloWorld
This is built with CLI tools.
The following directories are created:
7. Running Helloworld.xcodeproj
Open iOS project, run, run the results as follows:
This step encountered a problem, run an error:
.. /node_modules/react-native/packager/react-native-xcode. SH : react-/bin/sh127
Workaround:
https://github.com/facebook/react-native/issues/3948
Someone in this article gives a way to
.. /node_modules/react-native/packager/react-native-xcode.sh
At the beginning of the file, add:
SOURCE ~/.bash_profile
But I tried not to succeed.
The later approach is to comment out the last piece of code react-native-xcode.sh
#react-Native Bundle # --entry-file index.ios.js # --platform iOS # --Dev $DEV #"$DEST/main.jsbundle" #" $DEST "
Preliminary study on React Native