Reputation: 5306
I am new to react native and react-navigator and would like to achieve this setup:
I have no idea how to linked those up. If I put LoginScreen into my StackNavigator, I can navigate everything correctly, but during the signup process, user can goBack to the LoginScreen. SignUpScreen05 (content) user can also goBack to SignUpScreen which is not correct.
If I don't put them into the StackNavigator, I have no idea how to navigate from the LoginScreen. If possible, those (content and login) shouldn't be in the StackNavigator as I think those should be in different module, but I am not really sure how this should actually be done in react-navigator..
Any ideas? Thanks in advance!
Upvotes: 1
Views: 406
Reputation: 1565
You will probably need to nest your navigators
Your first StackNavigator will contains all the signup process + content (SignUpScreen01 to SignUpScreen05)
You'll have another StackNavigator, which is configured with {headerMode: "none"}
that contains:
-. your LoginScreen
-. your StackNavigator (SignUpScreen01..05)
-. your content (SignUpScreen05)
I know there seems to be duplication of your content, but it should be ok (I guess), since they are using the same component (and thus the same code), CMIIW or if somebody else has a better idea
Btw, the idea is similar to the solution proposed by the duplicated question :)
https://stackoverflow.com/a/44210967/474330
Upvotes: 1