我在屏幕上使用了两个导航器createStackNavigator
和createDrawerNavigator
。我要求我的“ HOME”屏幕(在createStackNavigator
中定义)必须先呈现而不传递到createDrawerNavigator
中,并且抽屉在HOME屏幕上绘制,而其他屏幕在抽屉中。但我收到此错误:
这是我的代码:
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import Home from './src/components/home'
import Account from './src/components/account'
import About from './src/components/about'
import {createAppContainer,createDrawerNavigator,createStackNavigator} from 'react-navigation';
class App extends Component {
render() {
return <MyApp />;
}
}
export default App;
const MyDrawerNavigator = createDrawerNavigator({
AppStack: AppStack,
Account: Account,
});
const AppStack = createStackNavigator({
Home: Home,
About: About,
});
const MyApp = createAppContainer(MyDrawerNavigator);
如何解决该错误?