时刻将 React Native 更新到最新的版本,可以获得更多 API、视图、开发者工具以及其他一些好东西(译注:官方开发任务繁重,人手紧缺,几乎不会对旧版本提供维护支持,所以即便更新可能带来一些兼容上的变更,但建议开发者还是尽一切可能第一时间更新)。由于一个完整的 React Native 项目是由 Android 项目、iOS 项目和 JavaScript 项目组成的,且都打包在一个 npm 包中,所以升级可能会有一些麻烦。我们会尽量简化这一流程。你可以在项目目录下使用npx react-native info命令查看当前的版本。There's currently two ways for upgrading your React Native project: by using React Native CLI or manually with Upgrade Helper.

React Native CLI#

The React Native CLI comes with upgrade command that provides a one-step operation to upgrade the source files with a minimum of conflicts, it internally uses rn-diff-purge project to find out which files need to be created, removed or modified.

1. Run the upgrade command#The upgrade command works on top of Git by using git apply with 3-way merge, therefore it's required to use Git in order for this to work, if you don't use Git but still want to use this solution then you can check out how to do it in the Troubleshooting section.

Run the following command to start the process of upgrading to the latest version:

npx react-native upgradeCopy

You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:

npx react-native upgrade 0.61.0-rc.0Copy

The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.

2. Resolve the conflicts#

Conflicted files include delimiters which make very clear where the changes come from. For example:

13B07F951A680F5B00A75B9A/* Release */={

isa=XCBuildConfiguration;

buildSettings={

ASSETCATALOG_COMPILER_APPICON_NAME=AppIcon;

<<<<<<

CODE_SIGN_IDENTITY="iPhone Developer";

FRAMEWORK_SEARCH_PATHS=(

"$(inherited)",

"$(PROJECT_DIR)/HockeySDK.embeddedframework",

"$(PROJECT_DIR)/HockeySDK-iOS/HockeySDK.embeddedframework",

);

=======

CURRENT_PROJECT_VERSION=1;

>>>>>>>theirs

HEADER_SEARCH_PATHS=(

"$(inherited)",

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,

"$(SRCROOT)/../node_modules/react-native/React/**",

"$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**",

);Copy

You can think of "ours" as "your team" and "theirs" as "the React Native development team".

Upgrade Helper#

The Upgrade Helper is a web tool to help you out when upgrading your apps by providing the full set of changes happening between any two versions. It also shows comments on specific files to help understanding why that change is needed.

1. Select the versions#

You first need to select from and to which version you wish to upgrade, by default the latest major versions are selected. After selecting you can click the button "Show me how to upgrade".

fragment中文网_更新 · React Native 中文网相关推荐

  1. React Native中文网

    React Native中文网 https://reactnative.cn/ 教程:http://v.youku.com/v_show/id_XMTQ5OTE3MjkzNg==.html

  2. reactnative 获取定位_【React Native】定位获取经纬度,当前城市等地址信息

    最近做React Native时,需要用到城市定位的功能,React Native中文网的定位部分中也提供了相应的方法.主要用到的方法有: 这里只需要获取到经纬度,城市等信息,持续监听的函数就不需要了 ...

  3. mobx在react中应用_借助React Native Elements,Jest和MobX MST可以轻松实现现实世界中的ReactNative应用...

    mobx在react中应用 by Qaiser Abbas 由Qaiser Abbas 借助React Native Elements,Jest和MobX MST可以轻松实现现实世界中的ReactNa ...

  4. native react 变颜色 点击_在React Native中按下更改按钮样式(Change button style on press in React Native)...

    问 题 我希望我的应用中按钮的样式在按下时更改.最好的方法是什么? 解决方案 使用 touchablehighlight . 这里有一个例子: 'use strict'; import react,{ ...

  5. reactnative 获取定位_[RN] React Native 获取地理位置

    import React, {Component} from 'react'; import {StyleSheet, Text, View}from 'react-native'; exportde ...

  6. React Native热更新方案

    随着 React Native 的不断发展完善,越来越多的公司选择使用 React Native 替代 iOS/Android 进行部分业务线的开发,也有不少使用 Hybrid 技术的公司转向了 Re ...

  7. React Native 热更新方案

    转载: https://blog.csdn.net/xiangzhihong8/article/details/73201421 随着 React Native 的不断发展完善,越来越多的公司选择使用 ...

  8. React Native之旅—热更新(Pushy)

    React Native(以下简称 RN)最吸引我的主要有三点:跨平台.性能良好.热更新,在体验了良好的性能和跨平台的便利之后,我便迫不及待的开始捣鼓热更新. 搜索了一圈回来发现,目前提供完整RN热更 ...

  9. React Native集成CodePush热更新

    作为一款以JavaScript语音为基础跨平台开发框架,React Native本身已经具备了动态更新的能力,不过官方却没有提供一套标准的动态更新方案.因为一个标准的动态更新方案,除了需要客户端具备动 ...

最新文章

  1. 网络设备中的linux,理解linux虚拟网络设备veth
  2. 一台物理机上VMware虚拟机实现拨号上网同时内网通信
  3. Arduino开发版学习计划
  4. 数据结构实验之链表三:链表的逆置
  5. JAVA多线程之CountDownLatch
  6. webserver之定时器
  7. spdlog linux编译出错,Linux下编写Makefile引入第三方库
  8. VMware日志收集方法总结
  9. matlab画图函数汇总(二)
  10. 七夕活动主题html邮件,七夕节活动策划方案,七夕创意活动主题
  11. 视频工具箱android,小熊视频工具箱
  12. klouderr什么意思_kid是什么意思_kid的翻译_音标_读音_用法_例句_爱词霸在线词典...
  13. 日常维护SQL以及脚本
  14. 【转】DDR3中的ODT
  15. ubuntu18.04安装搜狗拼音输入法
  16. 一文读懂CentOS 8 安装JDK 11:配置JAVA_HOME环境变量
  17. C++阶段06笔记01【基于STL的演讲比赛流程管理系统】
  18. Proxmox VE 6.0管理指南——3.主机系统管理
  19. stm32F429HAL库使用DS18B20输出温度到电脑串口助手
  20. 网络安全专业属于对照表(一)

热门文章

  1. 探索 TVM 进行量化方法
  2. DSP与CEVA芯片
  3. H.265 HD 和H.265 4K Video Encoder IP Core
  4. python可视化来分析全国疫情
  5. Failure [INSTALL_FAILED_ALREADY_EXISTS
  6. EventBus的使用(一看就懂)
  7. TableLayout 表格布局,FrameLaout 帧布局 ,AbsoluteLayout绝对布局的分析
  8. bash中case的用法
  9. react 子组件获取变量属性值
  10. 并发编程的那些事。(二)