Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace related issue in React-Native #2823

Closed
shyam1211 opened this issue Jan 22, 2018 · 1 comment
Closed

Replace related issue in React-Native #2823

shyam1211 opened this issue Jan 22, 2018 · 1 comment

Comments

@shyam1211
Copy link

shyam1211 commented Jan 22, 2018

project working ways :
Splash Screen -> Login Screen -> Signup Screen.
i working on navigate screens using router-flux .Like..
//code here







Already i hide the navigation back button .
but i want , when the hardware backbutton pressed in login screen it not going to splash screen.its should close the app.
i used type="replace" but its not working.Like

So please resolve these issue .

@Blapi
Copy link
Collaborator

Blapi commented Jan 22, 2018

Use the listener on BackHandler (imported from react-native)


    this.loginBackPressHandler = BackHandler.addEventListener('loginBackPress', () => {
      if (yourConditionToNotExitTheApp) {
        return true
      }
      return false
    })

Add this in your componentDidMount for example

@Blapi Blapi closed this as completed Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants