Undefined不是函数SwitchNavigator错误

时间:2018-06-01 06:31:58

标签: reactjs

我使用React Native并创建导航。但是这个模块给出了一个" undefined不是一个交换机SwitchNavigator"故障。我该怎么办?

我知道2.0版本,但我不想使用。因为这是给出的;

  

无法侦听与Redux商店无关的密钥。首先调用 createReactNavigationReduxMiddleware ,以便我们知道何时触发您的监听器

screenshot

react-navigation 1.0.0-beta.15
react-native expo



const NonAuthNavigator = StackNavigator(
    {
        Main: { screen: Main },
        Login: { screen: Login },
        Register: { screen: Register },
    },
    {
        initialRouteName: "Main",
        headerMode: "none"
    }
);
const AuthTabNavigator = TabNavigator(
    {
        Home: { screen: Home },
        Camera: { screen: Camera },
        Document: { screen: Document },
        Settings: { screen: Settings },
    },
    {
        initialRouteName: "Home",
        headerMode: "none"
    }
);
const LeftButtonNavigator = StackNavigator(
    {
        Menu: { screen: Menu },
    },
    {
        initialRouteName: "Main",
        headerMode: "none"
    }
);
const AuthMainNavigator = StackNavigator(
    {
        AuthTabNav: { screen: AuthTabNavigator },
        LeftButtonNav: { screen: LeftButtonNavigator }
    },
    {
        initialRouteName: "AuthTabNav",
        headerMode: "none"
    }
);
const AppNavigator = SwitchNavigator(
    {
        NonAuthNav: NonAuthNavigator,
        AuthMainNav: AuthMainNavigator,
    },
    {
        initialRouteName: 'NonAuthNav',
        headerMode: "none"
    }
);




0 个答案:

没有答案