1.下載初學者學習包
http://reactjs.cn/react/docs/getting-started.html
2.導入工程
用WebStorm導入工程,破解版連接
http://www.waitsun.com/jetbrains-webstorm-11-0-1.html ?
3.新建自己的Demo
(1)新建文件夾MyStudy
? ? ? ? 新建HelloReact.html
? ? ? ? 新建HelloReact.js
(2)輸入代碼
HelloReact.html
HelloReact.js
(3)執(zhí)行分離工具
? ? ? ? npm install -g react-tools ?#隨便那個文件夾都行
? ? ? ? cd /Users/catherine.liu/Documents/IOS/ReactDemo/react-15.3.0 #工程目錄
? ? ? ? #找準路徑,將jsx格式的js文件轉成標準的js蔽莱,執(zhí)行一次就行酌伊,以后修改會自動生成
? ? ? ? jsx --watch MyStudy/ ../build/ ? ?
? ? ? ?#到此宅静,你就可以在build文件夾下看到生成的js了奴璃,程序中也要正確引用
(4) 執(zhí)行結果