react-native-router-flux:没有为key undefined定义的路由。必须是“家庭”,“ activeJobs”,“收藏夹”,“收件箱”,“个人资料”之一

时间:2019-01-15 13:37:28

标签: react-native react-native-router-flux

我目前有一个本机生产的本机应用程序,昨天有 15 崩溃,引用此错误。因此,我非常渴望获得答案,因为我无法在我的开发环境或我自己的Android手机中重现此错误。

错误来自react-native-router-flux

这里是依赖项:

"react": "^16.6.3",
"react-native": "0.57.8",
"react-native-router-flux": "^4.0.6",

还有我的 Router.js

const RouterComponent = () => {
return (
<Router>
  <Scene key="root">
    <Scene
      initial
      hideNavBar
      key="spinner"
      headerMode="none"
      panHandlers={null}
      component={SpinnerComponent}
    />

    <Tabs
      lazy
      key="tabBar"
      hideNavBar
      headerMode="none"
      tabBarPosition={'bottom'}
      tabBarComponent={NavigationComponent}
    >
      <Scene
        initial
        key="home"
        headerMode="none"
        component={HomeComponent}
        panHandlers={null}
      />

      <Scene
        key="activeJobs"
        headerMode="none"
        component={ActiveJobsComponent}
        panHandlers={null}
      />

      <Scene
        key="favorites"
        headerMode="none"
        component={FavoritesComponent}
        panHandlers={null}
      />

      <Scene
        key="inbox"
        headerMode="none"
        component={InboxComponent}
        panHandlers={null}
      />

      <Scene
        key="profile"
        headerMode="none"
        component={ProfileComponent}
        panHandlers={null}
      />
    </Tabs>

    <Scene
      key="login"
      headerMode="none"
      component={LoginComponent}
      hideNavBar
      panHandlers={null}
    />

    <Scene
      key="displayOffer"
      hideNavBar
      headerMode="none"
      component={DisplayOffersComponent}
      panHandlers={null}
    />

    <Scene
      key="selectJob"
      hideNavBar
      headerMode="none"
      component={SelectJobComponent}
      panHandlers={null}
    />

    <Scene
      key="createJob"
      hideNavBar
      headerMode="none"
      component={JobScheduleComponent}
      panHandlers={null}
    />

    <Scene
      key="define_title"
      hideNavBar
      headerMode="none"
      component={DefineTitleComponent}
      panHandlers={null}
    />

    <Scene
      key="requirements"
      hideNavBar
      headerMode="none"
      component={RequirementsComponent}
      panHandlers={null}
    />

    <Scene
      key="quantity_question"
      hideNavBar
      headerMode="none"
      component={QuantityQuestionComponent}
      panHandlers={null}
    />

    <Scene
      key="add_comments"
      hideNavBar
      headerMode="none"
      component={AddCommentsComponent}
      panHandlers={null}
    />

    <Scene
      key="multiple_choice"
      hideNavBar
      headerMode="none"
      component={MultipleChoiceComponent}
      panHandlers={null}
    />

    <Scene
      key="user_description"
      hideNavBar
      headerMode="none"
      component={JobDetailsComponent}
      panHandlers={null}
    />

    <Scene
      key="photos_and_direction"
      hideNavBar
      headerMode="none"
      component={PhotosAndDirectionComponent}
      panHandlers={null}
    />

    <Scene
      key="price_or_offers"
      hideNavBar
      component={PriceOrOffersComponent}
      panHandlers={null}
    />

    <Scene
      key="googlePlaces"
      hideNavBar
      headerMode="none"
      component={GooglePlacesComponent}
      panHandlers={null}
    />

    <Scene
      key="chat"
      hideNavBar
      headerMode="none"
      component={ChatComponent}
      panHandlers={null}
    />

    <Scene
      key="publicProfile"
      hideNavBar
      headerMode="none"
      component={PublicProfileComponent}
      panHandlers={null}
    />

    <Scene
      key="cardDetails"
      hideNavBar
      headerMode="none"
      component={CardDetailsComponent}
      panHandlers={null}
    />

    <Scene
      key='verifyPhone'
      hideNavBar
      headerMode="none"
      component={VerifyPhoneNumberComponent}
      panHandlers={null}
    />

    <Scene
      key='payment'
      hideNavBar
      headerMode="none"
      component={PaymentComponent}
      panHandlers={null}
    />

    <Scene
      key='emailAndPassword'
      hideNavBar
      headerMode="none"
      component={EmailAndPasswordComponent}
      panHandlers={null}
    />

    <Scene
      key='confirmationAndReview'
      hideNavBar
      headerMode="none"
      component={ConfirmationAndReviewComponent}
      panHandlers={null}
    />

    <Scene
      key="extraOptions"
      hideNavBar
      headerMode="none"
      component={ExtraOptionsComponent}
      panHandlers={null}
    />

    <Scene
      key="jobCreation"
      hideNavBar
      headerMode="none"
      component={JobCreationLogicContainer}
      panHandlers={null}
    />
  </Scene>
</Router>
);
};

我使用Actions.jump('inbox');

在两个标签之间切换

有什么想法会发生这种情况吗?也许是路由器的设置方式?

0 个答案:

没有答案