React-native-router-flux: Can anyone help me with disabling back button on certain scenes?

Created on 13 Aug 2017  路  7Comments  路  Source: aksonov/react-native-router-flux

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>

Most helpful comment

type={ActionConst.RESET} in Scene

All 7 comments

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} />

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

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

Added to docs, closing.

type={ActionConst.RESET} in Scene

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vinayr picture vinayr  路  3Comments

sreejithr picture sreejithr  路  3Comments

rafaelcorreiapoli picture rafaelcorreiapoli  路  3Comments

maphongba008 picture maphongba008  路  3Comments

sylvainbaronnet picture sylvainbaronnet  路  3Comments