React-native-navigation: Initialise Navigation Stack With History

Created on 4 Jan 2018  ·  3Comments  ·  Source: wix/react-native-navigation

Issue Description

My app has quite a complicated sign up process which spans over multiple screens. I allow a user to start signing up, leave the app and return at a later date to complete it if they like. I store the screen id the user is currently on so that they start again where they left off.

However, if the app has been closed down I loose all of their navigation history. I can figure out the flow of pages that the user will have visited from the id of the screen the user is currently on.

Is it possible to push history to the navigator without actually having to navigate to the page? I've tried this sort of thing:

screens.forEach(screen => this.props.navigator.push({
  screen,
}));

Which doesn't really work since each screen gets displayed and actually ends up crashing the app! Ideally I need to initialise Navigation.startSingleScreenApp with pre-determined history.

Is this possible?


Environment

  • React Native Navigation version: 1.1.300
  • React Native version: 0.50.3
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator, Debug

Most helpful comment

Will be supported in v2

All 3 comments

Will be supported in v2

@guyca can you link to where this process is described in the docs/anywhere? I'm not seeing it yet.

@guyca

Is this done with setStackRoot and passing in an array of screens, the last of which will be the current screen?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

no23reason picture no23reason  ·  3Comments

henrikra picture henrikra  ·  3Comments

henrikra picture henrikra  ·  3Comments

swingywc picture swingywc  ·  3Comments

charlesluo2014 picture charlesluo2014  ·  3Comments