2017年9月1日 星期五

A Quick Start to React Native

A Quick Start to React Native
井民全, Jing, mqjing@gmail.com
Google Doc: This Document.

Environment
Ubuntu 17.04

Step 1: Install Packages
  • [install] How to install Node.JS (view)
  • sudo apt-get install git

Step 2: Create React-Native app
Command
sudo npm install -g create-react-native-app

Step 3: Create a new project
Command
create-react-native-app AwesomeProject
E.g.
Step 4: Start the dev. Server
Command
cd AwesomeProject/
npm start


IPhone Site

Step 1: Install Expo

Step 2: Scan the QR Code

Fig. The default text shows on iPhone.
Step 3: Start Coding.
Commnad
vi app.js

[Server Site] vi App.js


[Server Site] npm start
[iPhone Site]
Expo

Failure Case

If the server does not running, your iPhone will show an error message like this.

Reference