zoukankan      html  css  js  c++  java
  • React-Native到0.44版本后Navigator 不能用的问题

    新升级  到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} />
                  }
                } />

     

  • 相关阅读:
    nginx常用模块(三)
    Nmap脚本文件分析(AMQP协议为例)
    Nmap脚本引擎原理
    小型Basic编译器问题
    Nmap原理02
    基于Docker搭建GitLab服务器
    关于Telnet使用
    Linux系统搭建GitLab---阿里云Centos7搭建Gitlab踩坑
    Vi文本编辑器
    Linux 奇技淫巧之常用指令
  • 原文地址:https://www.cnblogs.com/wupeng88/p/7206102.html
Copyright © 2011-2022 走看看