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 StackNavigator with SwitchNavigator #315

Closed
pmespresso opened this issue Aug 12, 2019 · 1 comment · Fixed by #431
Closed

Replace StackNavigator with SwitchNavigator #315

pmespresso opened this issue Aug 12, 2019 · 1 comment · Fixed by #431

Comments

@pmespresso
Copy link
Contributor

Problem:

It seems before the v2.1 bump that we have been incorrectly using a StackNavigator for navigation, which was fine but with the latest version of react-navigation we had to work around it by setting key to undefined when resetting the route.

StackActions.reset({
                index: 1,
                key: undefined, // FIXME
                actions: [
                  NavigationActions.navigate({ routeName: 'AccountList' }),
                  NavigationActions.navigate({ routeName: next })
                ]
              });

Solution

The correct solution is to refactor our navigator to use a SwitchNavigator instead. react-navigation/react-navigation#1127 (comment)

IIRC I used the workaround as the refactor would be potentially quite hairy and that particular bump PR was already big and hairy enough.

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

Successfully merging a pull request may close this issue.

2 participants