这是我的代码:
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);
当我运行它时,会抛出此错误:
首先,为什么Navigator
在最新版本中已被弃用?我现在该怎么办?我几乎不认为安装一个被弃用的东西是个好主意。