Javascript React Native,导入app.js中的routes.js时出错

Javascript React Native,导入app.js中的routes.js时出错,javascript,reactjs,react-native,Javascript,Reactjs,React Native,我正在我的app.js中导入routes.js,但是它抛出了一个错误,TypeError:Super expression必须为null或一个函数,但是我正确地导入和导出了它,那么为什么它会显示这个错误,有人能帮忙吗?下面是我的代码 routes.js const RoutesContainer = data => { let intial_Route = 'AuthStack'; if (data.isLogin) { intial_Route = data.

我正在我的app.js中导入routes.js,但是它抛出了一个错误,
TypeError:Super expression必须为null或一个函数
,但是我正确地导入和导出了它,那么为什么它会显示这个错误,有人能帮忙吗?下面是我的代码

routes.js

const RoutesContainer = data => {
  let intial_Route = 'AuthStack';
  if (data.isLogin) {
    intial_Route =
      data.userType == USER_TYPE.PLAYER ? 'PlayerStack' : 'CoachStack';
  }

  return createAppContainer(
    createSwitchNavigator(
      {
        AuthStack,
        CoachStack,
        PlayerStack,
      },
      {initialRouteName: intial_Route},
    ),
  );
};

export default RoutesContainer;
这是我的routes.js,我很确定它是正确的

app.js

import RoutesContainer from './src/Routes';

render() {
    const {isLogin, userType} = this.state;
    const Routes = RoutesContainer({isLogin, userType});
    return (
      <Provider store={store}>
        <Text>Hello</Text>
        <Routes
          ref={navigatorRef => {
            NavigationService.setTopLevelNavigator(navigatorRef);
          }}
        />
        <FlashMessage position="top" />
      </Provider>
    );
  }
从“/src/Routes”导入RouteContainer;
render(){
const{isLogin,userType}=this.state;
constroutes=routeContainer({isLogin,userType});
返回(
你好
{
NavigationService.setTopLevelNavigator(navigatorRef);
}}
/>
);
}

这是我的app.js

你正在使用的导航版本是什么?我正在使用4.0版本控制createSwitchNavigator内的模式AuthStack:{screen:AuthStack}?是的,你能试试看所有路由吗?你正在使用的导航版本是什么?我正在使用4.0版本控制模式AuthStack:{screen:AuthStack}在createSwitchNavigator内部?是的,您可以尝试查看所有路由吗?