the problem when im on Scene 5 and i used "Actions.pop" send me to Scene 1
the steps
Scene 1 > 2 > 3 > 4 > 5 (when i use "Actions.pop" it must push me back to Scene 4 but it send me to the first Scene)
thnx and sorry if i add wrong issues and make new one and so sorry for my bad english
Can you give your code examples?
Actions.pop() will only work if you were using Actions.push() to add new views, if you are using replace for example it clears the routing stack.
Also IOS or Android as their "back" functionality is different.
i used action.SceneName
i test it on ios not android
im also experiencing this problem.
You might have replace the navigation stack at a moment, Actions.pop works just fine, the issue is in your code, not in the library.
Have a look at the example project, the best practices and the solution for your problems will be there.
Moreover, check your navigation stack by doing this :
const reducerCreate = (params) => {
const defaultReducer = new Reducer(params)
return (state, action) => {
console.log('Action :', action)
console.log('State :', state)
return defaultReducer(state, action)
}
}
...
...
<Router createReducer={reducerCreate}>
You will have the best overview to see what's wrong.
thnx alot and i fix it by move Drawer over (
new code :
<Router hideNavBar= "true" createReducer={reducerCreate}>
<Drawer key="drawer" contentComponent={DrawerContent} drawerWidth={250} hideNavBar>
<Scene key="root" hideNavBar>
<Scene key="home_page" component={home_page} title="home_page" initial={true} hideNavBar/>
<Scene key="search_page" component={search_page} title="search_page" hideNavBar/>
<Scene key="cats_page" component={cats_page} title="cats_page" hideNavBar/>
<Scene key="tops_page" component={tops_page} title="tops_page" hideNavBar/>
<Scene key="sound_page" component={sound_page} title="sound_page" hideNavBar />
<Scene key="sounds_page" component={sounds_page} title="sounds_page" hideNavBar />
<Scene key="aboutus_page" component={aboutus_page} title="aboutus_page" hideNavBar />
</Scene>
</Drawer>
</Router>
old code :
<Router hideNavBar= "true" createReducer={reducerCreate}>
<Scene key="root" hideNavBar>
<Drawer key="drawer" contentComponent={DrawerContent} drawerWidth={250} hideNavBar>
<Scene key="home_page" component={home_page} title="home_page" initial={true} hideNavBar/>
<Scene key="search_page" component={search_page} title="search_page" hideNavBar/>
<Scene key="cats_page" component={cats_page} title="cats_page" hideNavBar/>
<Scene key="tops_page" component={tops_page} title="tops_page" hideNavBar/>
<Scene key="sound_page" component={sound_page} title="sound_page" hideNavBar />
<Scene key="sounds_page" component={sounds_page} title="sounds_page" hideNavBar />
<Scene key="aboutus_page" component={aboutus_page} title="aboutus_page" hideNavBar />
</Drawer>
</Scene>
</Router>
thnx alot u help me
This helped me. Thank you!
Most helpful comment
thnx alot and i fix it by move Drawer over ()
new code :
<Router hideNavBar= "true" createReducer={reducerCreate}> <Drawer key="drawer" contentComponent={DrawerContent} drawerWidth={250} hideNavBar> <Scene key="root" hideNavBar> <Scene key="home_page" component={home_page} title="home_page" initial={true} hideNavBar/> <Scene key="search_page" component={search_page} title="search_page" hideNavBar/> <Scene key="cats_page" component={cats_page} title="cats_page" hideNavBar/> <Scene key="tops_page" component={tops_page} title="tops_page" hideNavBar/> <Scene key="sound_page" component={sound_page} title="sound_page" hideNavBar /> <Scene key="sounds_page" component={sounds_page} title="sounds_page" hideNavBar /> <Scene key="aboutus_page" component={aboutus_page} title="aboutus_page" hideNavBar /> </Scene> </Drawer> </Router>old code :
<Router hideNavBar= "true" createReducer={reducerCreate}> <Scene key="root" hideNavBar> <Drawer key="drawer" contentComponent={DrawerContent} drawerWidth={250} hideNavBar> <Scene key="home_page" component={home_page} title="home_page" initial={true} hideNavBar/> <Scene key="search_page" component={search_page} title="search_page" hideNavBar/> <Scene key="cats_page" component={cats_page} title="cats_page" hideNavBar/> <Scene key="tops_page" component={tops_page} title="tops_page" hideNavBar/> <Scene key="sound_page" component={sound_page} title="sound_page" hideNavBar /> <Scene key="sounds_page" component={sounds_page} title="sounds_page" hideNavBar /> <Scene key="aboutus_page" component={aboutus_page} title="aboutus_page" hideNavBar /> </Drawer> </Scene> </Router>thnx alot u help me