2016-05-27 37 views
5

我正在尝试升级到react-native(react-native-0.26.2)的最新版本,所以我可以使用react-native-flux-router。如何将react-native升级到最新版本

我收到此错误: screenshoterror

铬控制台只显示默认的错误消息。

这里是我的package.json文件

 "dependencies": { 
    "@remobile/react-native-splashscreen": "^1.0.3", 
    "firebase": "^3.0.3", 
    "jwt-decode": "^2.0.1", 
    "moment": "^2.12.0", 
    "node-uuid": "^1.4.7", 
    "q": "^1.4.1", 
    "react": "15.0.2", 
    "react-native": "0.26.2", 
    "react-native-action-button": "^1.1.4", 
    "react-native-android-statusbar": "^0.1.2", 
    "react-native-animatable": "^0.6.0", 
    "react-native-button": "^1.5.0", 
    "react-native-device-info": "^0.9.3", 
    "react-native-drawer": "^2.2.3", 
    "react-native-file-uploader": "0.0.2", 
    "react-native-gifted-spinner": "0.0.4", 
    "react-native-image-picker": "^0.18.17", 
    "react-native-keep-screen-on": "^1.0.3", 
    "react-native-maps": "^0.4.2", 
    "react-native-modalbox": "^1.3.3", 
    "react-native-orientation": "^1.16.0", 
    "react-native-router-flux": "^3.26.5", 
    "react-native-simple-store": "^1.0.1", 
    "react-native-vector-icons": "^2.0.2", 
    "react-timer-mixin": "^0.13.3", 
    "underscore": "^1.8.3" 
    }, 
    "devDependencies": { 
    "eslint": "2.10.2", 
    "eslint-plugin-react": "5.1.1", 
    "eslint-plugin-react-native": "1.1.0-beta" 
    } 

下面是来自亚行logcat输出

logcat output

采取

升级步骤: 注*为了得到当前的设置工作我们不得不安装l此特定版本

"assert": "1.3.0"

。原因是我得到一个缓冲区异常和搜索后,这是我发现solution to unknown module buffer

当我试图升级时,我得到了最新版本的反应,本机和反应。然后我降级反应的版本眼见反应本土警告消息后,要求

"react": "15.0.2"

然后我删除了断言包。我尝试了一切从卸载应用程序和重新编译,我试图重新启动计算机和手机。我发现的唯一的东西是这search result

所以我甚至安装了全球最新版本的巴贝尔,但不确定它做了什么。然后我也确定我在所有视图中都有构造函数中的东西。

export default class Home extends Component { 
    constructor(props) { 
     super(props); 
     this.state = { 
      foo: 'bar' 
     } 
    } 

我不确定接下来要做什么,因为控制台中没有有用的错误。

+0

你可以列出你在升级过程中迄今所采取的步骤是什么? –

+1

当然。将在电脑前大约一小时 – texas697

+0

请参阅更新请 – texas697

回答

5

对于React Native 0.26及更高版本,React本身不再与React Native捆绑在一起。此错误似乎是由propType定义造成的,您的或第三方组件尝试使用PropTypes.object

您需要更新该问题的组件或更改自己直接从react包这样的访问PropTypes

import React, { Component, PropTypes } from 'react'; 

class SomeComponent extends Component { 
    static propTypes = { 
    someProp: PropTypes.object 
    }; 
} 
+0

如果您有大量文件,有一个脚本可以帮助您。看看[这里](https://github.com/sibeliusseraphini/codemod-RN24-to-RN25)! –