Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在最新版本的React Native中使用Navigator?_Javascript_React Native_Url Routing - Fatal编程技术网

Javascript 如何在最新版本的React Native中使用Navigator?

Javascript 如何在最新版本的React Native中使用Navigator?,javascript,react-native,url-routing,Javascript,React Native,Url Routing,这是我的密码: import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, Navigator } from 'react-native'; import Component5 from './app/components/component5/component5.js'; import Component6 from './app/components/c

这是我的密码:

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  Navigator
} from 'react-native';

import Component5 from './app/components/component5/component5.js';
import Component6 from './app/components/component6/component6.js';

export default class myproject extends Component {
  renderScene(route, navigator){
    switch(route.id){
      case 'component5':
        return(<Component5 navigator={navigator} title="component5" />)
      case 'component6':
        return(<Component6 navigator={navigator} title="component6" />) 
    }
  }

  render() {
    return (
      <Navigator
        initialRoute={{id:'component5'}}
        renderScene={this.renderScene}
        configureScreen={(route, routeStack) => Navigtator.SceneConfigs.FloatFromBottom}
      />
    );
  }
}


AppRegistry.registerComponent('myproject', () => myproject);
import React,{Component}来自'React';
进口{
评估学,
样式表,
文本,
看法
领航员
}从“反应本机”;
从“/app/components/Component5/Component5.js”导入组件5;
从“./app/components/Component6/Component6.js”导入组件6;
导出默认类myproject扩展组件{
renderScene(路线、导航器){
交换机(route.id){
案例“组件5”:
返回()
案例“组件6”:
返回()
}
}
render(){
返回(
Navigtator.SceneFigures.FloatFromBottom}
/>
);
}
}
AppRegistry.registerComponent('myproject',()=>myproject);
当我运行它时,它抛出以下错误:


首先,为什么最新版本中不推荐使用
Navigator
?我现在该怎么办?我不认为安装一个不推荐的东西是个好主意。

忘记导航器,使用react导航


链接:

我明白了,谢谢你,向上投票。你觉得路由器流量怎么样?嗨,我不能对路由器流量发表任何评论,因为我以前没有用过它。但是如果你想找到一个新的导航解决方案,我会推荐react导航。这是一种“官方”的react原生导航解决方案,非常稳定。啊,你到底是说react导航吗?你在问题中链接的那个?是的,我在链接中提供的那个。这是react导航,不是“react-native-navigation”忘记react导航,试试react-native导航