ReactNative0.44之后不能使用Navigator
来源:互联网 发布:mac重复照片清理软件 编辑:程序博客网 时间:2024/05/18 03:31
在使用react native开发时,使用navigator出现了一个错误。错误提示为:
'Navigator is deprecated and has been removed from this package. It can now be installed ' + 'and imported from `react-native-deprecated-custom-components` instead of `react-native`. ' + 'Learn about alternative navigation solutions at http://facebook.github.io/react-native/docs/navigation.html'
"dependencies": { "react": "16.0.0", "react-native": "0.51.0" },
1.打开我们的项目文件,例如我的项目时NavigatorValue(在E:\Project\ReactNativeProject\NavigatorValue),打开命令提示窗口,进入到这个目录下。
2.输入下面这个命令npm install --savehttps://github.com/facebookarchive/react-native-custom-components.git
(注意:我在试过了npm install react-native-deprecated-custom-components --save这个方法。总是报
React-Native – undefined is not an object (“evaluating _react3.default.PropTypes.shape”)如果你已经安装了,使用(npm uninstall --save react-native-deprecated-custom-components卸载了)。
3.在我们使用Navigator的js文件中加入下面这个导入包就可以了。
import { Navigator } from'react-native-deprecated-custom-components';(注意最后有一个分号)
4.就可以正常使用Navigator组件了。
在备注二中有一个实例可以下载看看试试。
备注:
一、如果使用npm下载失败的话,还有一种办法:
1.在我们项目目录下的pagejson.json文件中,加入下面内容:
"dependencies": { "react": "16.0.0", "react-native": "0.51.0", "react-native-deprecated-custom-components": "git+https://github.com/facebookarchive/react-native-custom-components.git" },
然后下载Navigator额外的包,并放入到node_modules文件夹中。地址是:
http://download.csdn.net/download/cw_hello1/10167195
这样就可以使用了navigator。在需要使用Navigator的js文件中加入:
import { Navigator } from'react-native-deprecated-custom-components';(注意最后有一个分号)
二、一个Navigator的实例:
地址:http://download.csdn.net/download/cw_hello1/10167186
如果有什么问题,可以去加3224272023QQ.或者在下面提问。
如果有帮助的话,可以扫一扫。
- ReactNative0.44之后不能使用Navigator
- iOS,不能使用UDID之后
- KSImageNamed插件安装之后不能使用(VVDocumenter)
- Xcode 升级之后插件不能使用了
- jq ajax之后函数不能使用问题
- Android打包签名之后不能使用
- 经常使用Lantern, 之后不能正常上网
- kali升级之后theharvester不能使用
- Source Navigator 使用
- navigator对象的使用
- 初次使用Source Navigator
- ReactNative Demo - Navigator 使用
- 组件Navigator的使用
- 安装Oracle后myEclipse不能正常使用之后
- 调用 BinaryRead 之后,不能使用一般 Request 集合
- 为什么我设置代理服务器的之后,还是不能使用pi
- 使用SharedPreferences即时存储之后,不能即时获取到数据
- 升级xcode6.4之后插件不能使用的问题
- Unity安卓开发环境搭建
- jdbc连接数据库
- 使用Wireshark 在Mac上,抓iPhone的数据
- 对Netty服务端的 UpStream和DownStream的浅识
- linux 批量转换GBK到UTF-8编码的方法
- ReactNative0.44之后不能使用Navigator
- 启动web项目时报网页cookie重定向多次解决方法
- 好文索引
- Redis持久化存储(AOF与RDB两种模式)
- ORB_SLAM2 with kinect-v1
- [译]Android Application启动流程分析
- 简单实现美团城市切换
- Xilisoft Photo Slideshow Maker for Mac(电子相册制作)附注册机 V1.0.2中文破解版
- 我所了解的IT行业风险投资