question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

goBack or pop not work in first time

See original GitHub issue

Version

^4.0.0-beta.28

 <Router     createReducer={this.reducerCreate}>
                <Scene>
                    <Drawer
                        key="SearchScreen"
                        contentComponent={() => <DrawerComponent goToScreen={this.goToScreen}/>}
                        drawerPosition="right"
                        hideNavBar
                        drawerUnderNavBar={true}
                        initial
                    >
                        <Scene  >
                            <Scene key="SearchScreen1" component={ScreenSearchStep1} initial/>
                            <Scene key="SearchScreen2" component={ScreenSearchStep2} />
                            <Scene key="SearchScreen3" component={ScreenSearchStep3}/>
                            <Scene key="MelkScreen" component={ScreenMelk}/>


                        </Scene>
                    </Drawer>
                    <Scene key='AppScreen' hideNavBar>
                        <Scene key="ContactScreen" component={ContactScreen}/>
                        <Scene key="AboutScreen" component={AboutScreen}/>
                    </Scene>
                    <Scene key='UserScreen' hideNavBar >
                        <Scene key="LoginScreen" component={ScreenLogin}  />
                        <Scene key="ScreenRegister" component={ScreenRegister} />
                    </Scene>

                    {/*<Scene key="SplashScreen" component={ScreenSplash} hideNavBar initial/>*/}


                    {/*<Scene  hideNavBar initial>*/}

                    {/*</Scene>*/}

                </Scene>

            </Router>

my initial screen is “SearchScreen1” in Drawer Scene, when i use Actions.LoginScreen () for go to the login screen is work fine , but when i click back button back button work fine but not go to SearchScreen1, stay in Login screen, when I click again on back button in login screen this time is work and scrren change and navigate to SearchScreen1 i try back with Actions.pop() or navigation.goBack() , But it does not matter why can not back in first time ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
Blapicommented, Feb 23, 2018

So use Actions.pop() no ??? Why keep using navigation.goBack() if it’s not working but it’s working as expected with Actions.pop() ?!

0reactions
dborzoueicommented, Feb 23, 2018

no , this not work . When I’m pressed the back button 2 times . this work Of course, with the code Actions.pop(). in first time not back to main screen . if i use navigation.goBack() , this never back

Read more comments on GitHub >

github_iconTop Results From Across the Web

Going back isn't popping navigation corretly with React ...
When I go to the LandingPage -> ProfilePage (userId 4) -> Following then press navigation.goback() has not problem. It takes me back to...
Read more >
How to go back to another stack navigator? goBack / pop ...
PROBLEM: from Dashboard Landing screen, if I do navigation.navigate('AccountDetails'); it takes me to AccountDetails ,.
Read more >
Moving between screens - React Navigation
Each time you call push we add a new route to the navigation stack. When you call navigate it first tries to find...
Read more >
How to properly navigate with React Navigation | Alien Brains
In this article, you will learn various ways to navigate in your application using React Navigation. I will assume that you know the...
Read more >
Flutter: Refresh on Navigator pop or go back | NStack India
How go back works? # · By pressing Native Back Button on your phone · By press the Back Button on app bar...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found