React Native 升级到版本到0.25.1
React Native的更新策略是两个星期迭代一个新版本,使用的React Natvie没有多长时间就需要升到最新版本了,这里介绍下如何升级到版本0.25.1以及其以上。 React Native 25,一个显著的变化是import React的时候不再从 使用React首先要添加 npm WARN react-native@0.31.0 requires a peer of react@~15.2.1 but none was installed. 就需要我们添加对于
也可以在 { "name": "rn310","version": "0.0.1","private": true,"scripts": { "start": "node node_modules/react-native/local-cli/cli.js start" },"dependencies": { "react": "^15.2.1","react-native": "0.31.0" } } 在运行 import React from 'react'React Native 25之后,除了React不再从 Seems you're trying to access 'ReactNative.Component' from the 'react-native' pakeage. Perhaps you meant to access 'React.Component' from the 'React' package instead? For example,instead of : import React,{ Component,View } from 'react-native'; you should now: import React,{ Component } from 'react'; import { View } from 'react-native'; .....
提示的内容就是告诉我们需要把Component,React等从包
等待运行完成之后可以看到 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |