react-native-router-flux: Cant return a initial Scene from Drawer

Version

Tell us which versions you are using:

  • react-native-router-flux v3.31.2
  • react-native v0.34.1

My index tree

<Router>
   <Scene key="root" >
      <Scene key='Login' component={Login} />
      <Scene key='Drawer' component={SideDrawer} />
         <Scene key='drawerRoot' />
             <Scene key='Home' component={Home} />
         </Scene>
      </Scene>
   </Scene> 
</Router>

Expected behaviour

Go to initial Scene on LogOut

Actual behaviour

If i put Actions.Login() navigation go to Drawer. If i put Actions.Login({type: ‘reset’}) app crash with: Cannot read property sceneKey of undefined

Steps to reproduce

  1. Init in Login
  2. Actions.Drawer({type: ‘reset’})
  3. From home: Actions.Login({type: ‘reset’})
  4. App crash with error: Cannot read property sceneKey of undefined

How can i fix it?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Ok the error is for this functions of my SideDrawercomponent:

        onOpen={()=>Actions.refresh({key:state.key, open: true})}
        onClose={()=>Actions.refresh({key:state.key, open: false})}

For fix it, i only have to remove drawer.close(); from LogOut onPress button in SideDrawerContent.js

Thanks for help @dragfire

Do like this Actions.Drawer() without {type: 'reset'}.