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
- Init in Login
- Actions.Drawer({type: ‘reset’})
- From home: Actions.Login({type: ‘reset’})
- 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
- V4 announcement, v3 is obsolete now; closes #1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16,#17,#18,#19,#20,#21,#22,#23,#24,#25,#26,#27,#28,#29,#30,#31,#32,#33,#34,#35,#36,#37,#38,#39,#40,#41,#... — committed to aksonov/react-native-router-flux by aksonov 7 years ago
- V4 docs; closes #1,closes #2,closes #3,closes #4,closes #5,closes #6,closes #7,closes #8,closes #9,closes #10,closes #11,closes #12,closes #13,closes #14,closes #15,closes #16,closes #17,closes #18,cl... — committed to aksonov/react-native-router-flux by aksonov 7 years ago
Ok the error is for this functions of my
SideDrawer
component:For fix it, i only have to remove
drawer.close();
fromLogOut
onPress button inSideDrawerContent.js
Thanks for help @dragfire
Do like this
Actions.Drawer()
without{type: 'reset'}
.