无法在React导航中渲染抽屉导航?

时间:2019-05-11 13:19:05

标签: javascript reactjs react-native react-navigation-drawer

嗨,有一个反应式导航方法可以创建一个抽屉,该抽屉位于createSwitchNavigator内部。但是在进行最后一次通话时,我无法正确渲染抽屉。我正在

不断出现违规错误。

This is my drawer:
const MyDrawerNavigator = createDrawerNavigator({
    Home:{
       screen: DashboardScreen,
    },
    Notifications: {
       screen: UserMeetingScreen,
    },
  });

 const MyApp = createAppContainer(MyDrawerNavigator);

 export default MyApp

这是我的堆栈导航器

import AppStack from '../navigator/loggedIn';
import AuthStack from '../navigator/loggedOut';
import LoadingScreen from '../components/Loading/loading.component';

export const GetAppStack = createAppContainer(createSwitchNavigator(
    {   
        AuthLoading: LoadingScreen,
        LoggedOut: AuthStack,
        LoggedIn: AppStack,
    },
    {
        initialRouteName: 'AuthLoading',
    }
))

这是我的仪表板组件

export default class DashboardScreen extends React.Component{

    static navigationOptions = {
        headerMode: 'none',
        headerStyle:{
            backgroundColor: '#4F6D7A',
            elevation: 0
        }
    }

    render(){
        return (
            <View>
                <OfflineNotice />
                <Icon 
                name= 'flight-takeoff'
                onPress= {()=> this.props.navigation.openDrawer()}
                ></Icon>
            </View>
        )
    }
}

我收到一个“元素类型无效”错误。检查仪表盘屏幕的渲染方法。我在做什么错了?

0 个答案:

没有答案