React-Native到0.44版本后Navigator 不能用的问题
2017-07-19 15:38
363 查看
新升级 到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 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} /> } } />
相关文章推荐
- React-Native到0.44版本后Navigator 不能用的问题
- ReactNative0.44之后不能使用Navigator
- react native编译需要android ndk版本问题
- 解决react-native-swiper在安卓上与react navigation TabNavigator一起用时不显示内容问题
- 解决react-native的Navigator跳转不刷新页面的问题
- ReactNative学习问题笔记1:android工程中需要引用jar包中的aidl类时不能编译的问题
- 解决react-native-swiper在安卓上与TabNavigator共用时不显示内容问题
- Windows版本搭建安装React Native环境配置 count not find tools.jar问题
- ReactNative debug in Chrome 不能连接Chrome调试问题 (iOS)
- react-router V4 版本不能嵌套路由的问题
- react-native 部分手机二维码扫面页面黑屏的问题(不能使用相机)
- 解决RN0.44版本tabBarIOS不能隐藏的问题
- React Native 键盘管理和 Tab Navigator 在Android TextInput遮盖,Tab Navigator上移等问题解决办法
- react-native-router-flux popTo('想pop到的scene') 回退多级不能实现问题
- React-Native 学习之--问题处理 一. github上下载的项目不能运行?
- React-native android 启动遇到的问题
- react native项目中的问题记录
- React-Native解决键盘遮挡问题(Keyboard遮挡问题)