1.1.2 • Published 3 years ago

@react-sextant/upgrade-auto v1.1.2

Weekly downloads
4
License
ISC
Repository
-
Last release
3 years ago
版本升级指南
0.60+内置组件移除

如何使用?

$ npm i @react-sextant/upgrade-auto

$ npm run upgrade-components

package.json变化⚠️

安装成功后 package.json将会被自动修改⚠️ 那些被移除的内置组件,需要在package.json中的upgradeDependencies字段中添加对应替换的npm包名

 {
   "name": "xxx",
   "version": "0.0.1",
   "scripts": {
     ...
  • "upgrade-components": "node node_modules/@react-sextant/upgrade-auto/upgrade-components.js" },

    ...

  • "upgradeDependencies": {

  • "NavigationActions": "@react-navigation/compat > react-navigation",
  • "ART": "import * as ART from '@react-native-community/art'",
  • "WebView": "react-native-webview",
  • "NetInfo": "@react-native-community/netinfo",
  • "CameraRoll": "@react-native-community/cameraroll",
  • "ImageEditor": "@react-native-community/image-editor",
  • "ViewPagerAndroid": "@react-native-community/viewpager"
  • }

    }

# 当React-Native版本升级时遇到了问题

<details>
<summary><b>常见问题1:</b></summary>
<code>
'WebView has been removed from React Native. It can now be installed and imported from 'react-native-webview' instead of 'react-native'. " See https://github.com/react-native-community/react-native-webview',
</code>
</details>

## 移除了哪些组件?
https://github.com/react-native-community/releases/blob/master/CHANGELOG.md#removed-3

## 第三方库不再维护怎么办?

 - fork+自己维护
 - 使用本脚步自动更新(适用于仅仅改个组件依赖方式)
   ```diff
   -  import {WebView, Button} from 'react-native'
   +  import {Button} from 'react-native'
   +  import {WebView} from 'react-native-native'