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

Can anyone help me with disabling back button on certain scenes? #2227

Closed
themakerman opened this issue Aug 13, 2017 · 7 comments
Closed

Can anyone help me with disabling back button on certain scenes? #2227

themakerman opened this issue Aug 13, 2017 · 7 comments

Comments

@themakerman
Copy link

themakerman commented Aug 13, 2017

Version

Tell us which versions you are using: ^4.0.0-beta.17

I used to nest Scenes into buckets to stop users going to the previous screen. This is not working
now on latest build. Can anyone please help me out? Below is the code.
Logic is that user should be shown splash screen only once. Later on user cannot go back to splash screen.

<Router>
      <Scene key="root">
          <Scene key="splash" component={SplashScreen} initial  />
          <Scene key="Screen1" component={Screen1} />
          <Scene key="Screen2" component={Screen2} />
      </Scene>
 </Router>
@zainmustafa
Copy link

You can use type="replace" in Screen1 scene to stop users going back to splash screen.
Try this for Scene1

<Scene key="Screen1" type="replace" component={Screen1} />

@themakerman
Copy link
Author

Awesome. Finally something that worked. @zainmustafa i wonder why this prop is nowhere in v4 DOCS.

@zainmustafa
Copy link

Yeah, it has to be there in docs. Glad it helped.

@aksonov
Copy link
Owner

aksonov commented Aug 14, 2017

Added to docs, closing.

@aksonov aksonov closed this as completed Aug 14, 2017
@ghost
Copy link

ghost commented Feb 16, 2018

type={ActionConst.RESET} in Scene

@RaviGehlot2
Copy link

You can use type="replace" in Screen1 scene to stop users going back to splash screen.
Try this for Scene1

<Scene key="Screen1" type="replace" component={Screen1} />

yeah its working

@surbhitrao
Copy link

surbhitrao commented Apr 21, 2020

Replace did not work for. This is what worked in my case:
https://stackoverflow.com/a/61349171/5950360

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

5 participants