taro之React Native 端开发研究

初步结论:如果想把 React Native 集成到现有的原生项目中,不能使用taro的React Native 端开发功能(目前来说不能实现,以后再观察)。
 
RN开发有2种模式:
1、一是原生Android/IOS混合起来的开发(这种开发目前在国内,从事的比较多)  react-native init projectName
 
2、CRNA(create react native app)模式开发(通常结合Expo)。
 
环境配置比较:
第一种方法要求的开发环境比较繁杂,需要 node / watchman / jdk / android sdk,android studio / xcode 等等。
第二种可以摆脱android studio 和 xcode ,只要在手机上安装expo client就可以开发, 当然你也可以在android studio 和 xcode 查看项目效果
 
打包比较:
第一种打包需要依懒android studio 和 xcode , 配置繁琐。
第二种只需要 配置 app.json 然后运行 exp build:android 或 exp build:ios 就可以打包了。说的是整个项目。
 
而taro的React Native 端开发正是采用第二种模式。https://nervjs.github.io/taro/docs/react-native.html
如图:
 
 
 
Follow these instructions if you need to build native code in your project. For example, if you are integrating React Native into an existing application, or if you "ejected" from Create React Native App, you'll need this section.
 
大致意思就是:如果您正在将React Native集成到现有应用程序中,或者如果您“排除使用”Create React Native App,则需要本节。就是我们所说的正常的这种RN的开发方式。
 
并且由于 Taro RN 端是基于 Expo,因此不支持 需要自定义原生组件 的第三方库。
posted @ 2019-02-13 11:06  yoowei  阅读(4939)  评论(0编辑  收藏  举报