随笔分类 -  react native

摘要:https://facebook.github.io/react-native/docs/running-on-device.html 在发布之前,最好是在真实的设备上测试一下应用。如果是通过create react native app来创建的项目,可以通过Expo扫描二维码来预览我们的应用。为了 阅读全文
posted @ 2018-01-21 20:28 HelloHello233 阅读(1245) 评论(0) 推荐(0)
摘要:https://facebook.github.io/react-native/docs/performance.html 一个使用RN而不是webView的重要原因是可实现60fps以及更类似原生app的用户体验。RN的性能比较好,但某些地方仍然需要用户去手动优化 帧 打开Show Perf Mo 阅读全文
posted @ 2018-01-21 20:09 HelloHello233 阅读(1256) 评论(0) 推荐(0)
摘要:https://facebook.github.io/react-native/docs/headless-js-android.html 当app在 后台运行 时,我们可以使用RN服务来同时地刷新数据、推送或者播放音乐。 JS API 在JS中注册一个后台任务(不能操作UI,一般是网络请求、定时器 阅读全文
posted @ 2018-01-21 13:03 HelloHello233 阅读(629) 评论(0) 推荐(0)
摘要:https://facebook.github.io/react-native/docs/native-components-android.html 这里有一大堆的原生组件可以用,一些是平台自带的,另一些是第三方库的,而更多的正在其他项目中被使用。RN包装了大部分核心平台组件,但不是所有。幸运的是 阅读全文
posted @ 2018-01-20 15:26 HelloHello233 阅读(1978) 评论(0) 推荐(0)
摘要:https://facebook.github.io/react-native/docs/native-modules-android.html RN实际就是依附在原生平台上,把各种各样的RN组件展示出来。所以RN如果可以访问原生代码的话,可以实现更高的复用性,以及做一些RN做不到的事情,如多线程图 阅读全文
posted @ 2018-01-20 11:49 HelloHello233 阅读(688) 评论(0) 推荐(0)
摘要:https://facebook.github.io/react-native/docs/integration-with-existing-apps.html RN可以很好地支持往一个原生的app上添加RN的组件。通过简单的步骤,我们可以添加RN基础的特征、组件等。后面以android为例。 关键 阅读全文
posted @ 2018-01-18 15:10 HelloHello233 阅读(4619) 评论(0) 推荐(0)
摘要:https://facebook.github.io/react-native/docs/direct-manipulation.html setNativeProps可以直接修改底层native组件的属性,不与React相关(state不会跟着同步),其他原生方法还有measure、measure 阅读全文
posted @ 2018-01-18 14:35 HelloHello233 阅读(1494) 评论(0) 推荐(0)
摘要:https://facebook.github.io/react-native/docs/debugging.html 热加载 RN的目标是极致的开发体验,修改文件后能在1秒内看到变化,通过以下三个特征来实现: 有了以上功能,剩余的瓶颈就是刷新后会丢失app当前的状态,手动还原了当前要调试的状态需要 阅读全文
posted @ 2018-01-17 22:03 HelloHello233 阅读(1841) 评论(0) 推荐(0)
摘要:使用夜神 使用夜神作为模拟器,这个模拟器启动就会监听62001端口。 开发工具与模拟器的通信都是通过adb。夜神模拟器的安装目录/bin下有一个adb.exe,android sdk tools下也有一个adb.exe。必须保证两者的adb版本一致(否则两个adb进程version不一致会互相kil 阅读全文
posted @ 2018-01-16 19:02 HelloHello233 阅读(385) 评论(0) 推荐(0)
摘要:https://facebook.github.io/react-native/docs/using-a-listview.html react native类似于react,不过它使用的是原生组件,而不是web组件。也就是说不能div或span等。react native使用jsx、state、p 阅读全文
posted @ 2018-01-15 22:48 HelloHello233 阅读(169) 评论(0) 推荐(0)