Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

navigation.continue / next: push but without passing in a route name #37

Open
peterpme opened this issue Mar 28, 2018 · 3 comments
Open

Comments

@peterpme
Copy link
Contributor

peterpme commented Mar 28, 2018

👋

Given a stack navigator with the following routes:

{
  Login,
  ConnectGmail,
  Loading,
  Welcome
}

What

I'm proposing a navigation.continue or navigation.next method that will automatically determine the next route in line.

Why

Over the past 6 months we've built different onboarding flows and moving routes around for testing purposes. I have to open up individual files and update to the correct route name.

This isn't the worst thing in the world, but if I could do this at the navigator level it would improve my productivity.

Issues

  • sort order may be inconsistent. I would propose a key that would maintain sort order for you:
{
 Login: { key: 0, screen: LoginScreen }
}

How

I would be more than happy to implement this.

Thank you!

@ericvicenti
Copy link
Contributor

‘continue’ seems like a useful feature to add to stack router. Could we make the “order” API match that of tab router? It uses the order of keys in the object by default, which is technically not defined in the JS spec, but usually works nonetheless. The correct way to define it is to explicitly provide the order in the router config

@peterpme
Copy link
Contributor Author

Of course, thanks! wrt sort order, I figured as much but wanted to bring it up anyway 😄

Do you want a formal RFC pr for this?

@satya164
Copy link
Member

This is interesting feature. With v5, order is derived from the order of Screen elements, so we don't need a separate thing for that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants