Skip to content

Router issues when popping from a modal presented from the root #192

@ninjz

Description

@ninjz

I have my routes set up like this:

<Router
  onPush={onEnterHandler}
  onReplace={onEnterHandler}
  onPush={onEnterHandler}
  hideNavBar={true} >
  <Schema name="modal" sceneConfig={Navigator.SceneConfigs.FloatFromBottom}/>
  <Schema name="default" sceneConfig={Navigator.SceneConfigs.FloatFromRight}/>
  <Schema name="withoutAnimation"/>
  <Schema name="tab" type="switch" icon={TabIcon} />

  <Route name="pager" schema="modal" onPop={()=>{return false}} wrapRouter={true} component={PromoPager} hideNavBar={true} title="PopularPager" />
  <Route name="bizpage" schema="modal" wrapRouter={true} component={BusinessPage} title="Starbucks"/>

  <Route name="initial" initial={true}>
    <Router footer={TabBar} showNavigationBar={false} style={{backgroundColor:'#24272A'}} >
      <Route name="main" schema="tab" source={require('./components/img/innactive_main.png')} component={MainFeed} hideNavBar={true} title="MainFeed"/>
      <Route name="popular" schema="tab" component={PopularFeed} source={require('./components/img/innactive_popular.png')}  title="PopularFeed"/>
      <Route name="activity" schema="tab" source={require('./components/img/innactive_activity.png')} hideNavBar={false} component={ActivityFeed} title="Activity"/>
      <Route name="profile" schema="tab" source={require('./components/img/innactive_profile.png')} component={ProfileView} title="Profile"/>
    </Router>
  </Route>
</Router>

So my issue is that I am opening a modal within the "popular" route which is presented from the root because i need it to cover the tab bar. I am able to pop the modal, but when switching to another tab I get this error:

screen shot 2016-02-10 at 2 07 37 am

My only ideas I have would be to keep track of the previous router when opening and closing the modal and manually assigning it back when popping the modal. But even then I don't know how I would go about doing that. Any ideas? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions