React-Native到0.44版本后Navigator 不能用的问题
2024-08-26 21:51:29
新升级 到0.46版本以后 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'
解决方案:
1、cd 当前目录
2、npm install react-native-deprecated-custom-components --save
3、import {Navigator} from 'react-native-deprecated-custom-components';
4、
<Navigator
initialRoute={{ name: '首页', component: Home }}
//配置场景
configureScene=
{
(route) => { //这个是页面之间跳转时候的动画,具体有哪些?可以看这个目录下,
//有源代码的: node_modules/react-native/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js // return Navigator.SceneConfigs.PushFromRight;
return ({
...Navigator.SceneConfigs.PushFromRight,
gestures: null,
});
}
}
renderScene={
(route, navigator) => {
let Component = route.component;
return <Component {...route.params} navigator={navigator} />
}
} />
最新文章
- RSA加密例子和中途遇到的问题
- Java 导入Excel文件到数据库
- OC之NSString、NSMutableString学习笔记 常用方法
- jQuery plugin: Autocomplete 参数及实例
- hostapd源代码分析(三):管理帧的收发和处理
- HDAO one error
- 2014多校第六场 1010 || HDU 4930 Fighting the Landlords (模拟)
- Remove Duplicates from Sorted List @LeetCode
- 省市区三级联动JS
- VCRedist.exe静默安装方法(转)
- Nginx启动报错:10013: An attempt was made to access a socket in a way forbidden
- USACO Ski Course Design 暴力
- Java 建立mysql数据库连接的语句
- JS放大镜特效(兼容版)
- iOS开发中怎么样使用激光推送
- [leetcode-624-Maximum Distance in Arrays]
- 点击截图功能 js canvas
- 适用于单片机的数据加密算法:xxtea
- IDEA 中tomcat日志位置
- 谈谈java程序代码保护及license设计
热门文章
- 电脑丢失api-ms-win-core-libraryloader-|1-1-1.dll怎么办
- 「PKUWC 2018」Minimax
- GDI+学习---1.初识GDI+
- java.lang.Enum
- redis-deskmanager 连不上 虚拟机 - centos redis
- F - Auxiliary Set HDU - 5927 (dfs判断lca)
- super和this的区别
- Java类加载双亲委托模式优点
- 基于ATT和CK™框架的开放式方法评估网络安全产品
- 设置LISTControl控件某一行的背景和文字颜色