Windows上React-Native環境搭建-只適合Android開發者

分類:編程 時間:2017-02-17

從來不寫博客,這次做了筆記,就放上來好了。

1、React-Native環境搭建

         http://www.lcode.org/%E5%8F%B2%E4%B8%8A%E6%9C%80%E8%AF%A6%E7%BB%86wind   ows%E7%89%88%E6%9C%AC%E6%90%AD%E5%BB%BA%E5%AE%89%E8%A3%85react-nati       ve%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/

            http://reactnative.cn/docs/0.39/getting-started.html#content

2、IDE:WebStorm 3.2.1 破解:http://www.cnblogs.com/woaic/p/6024975.html

                   1)要下載最新的WebStorm,否則對不支持,ide會報錯

                   2) cd c:/workspace    react-native init MyProject     react-native run-android

                   3)導入工程WebStorm  File->open->MyProject

                   4)配置開發環境 File->Setting->Languages&Frameworks->JavaScript

                            ->javascriptlanguage version React JSX

                   5) 配置編譯配置Run -> EditConfigurations -> "+"-> React Native ->{Name:Android  ... OK}

                   6)編譯 Run-> RunAndroid 或者 在命令行react-native run-android

         註意:1ANDROID_HOME環境變量配置,只能配置android_sdk所在目錄,多一個分號都不行,                    否則會報錯,找不到sdk目錄

               2React Native 小米手機安裝失敗Failed to establish session 解決方案: 進入開發                    者模式,關閉“MIUI優化”

               3在小米、華為上,新安裝的app會出現一個應用列表頁,在列表中找到我們的RN app,               並開啟允許在其他應用的上層顯示,然後返回到首頁。

               4demo默認支持x86,包體大小7M多,在build.gradle中去除x86支持,demo包體大                     小會降低到4M左右

3、工程結構

4、react本身的一些概念(如JSX,組件,state)

                   http://www.ruanyifeng.com/blog/2015/03/react.html

                   https://Facebook.github.io/react/docs/components-and-props.html   

5、ES6轉ES5  babel script.js --out-file script-compiled.js

         目前使用,感覺有ES6就夠了。

6、RN介紹及組件

         http://reactnative.cn/docs/0.39/style.html#content



Tags: Android Windows 解決方案 小米手機 version

文章來源:


ads
ads

相關文章
ads

相關文章

ad