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

Navigation helper names #4

Open
brentvatne opened this issue Jan 26, 2018 · 0 comments
Open

Navigation helper names #4

brentvatne opened this issue Jan 26, 2018 · 0 comments

Comments

@brentvatne
Copy link
Member

brentvatne commented Jan 26, 2018

  • navigate: it can be used in a variety of situations, but people learn it first as a way to push a route onto the stack, and the word seems best suited for that case. But you can do all sorts of things with navigate, such as go back (using a key)

  • goBack: we should distinguish between the goBack(null) and goBack() and goBack({key: 'someKey'}) cases with separate helpers with more intention revealing names.

    • goBack() - no key passed in, defaults to the key for the current route
    • goBack(key) - go back from this key to the route before it
    • goBack(null) - let any navigator handle this back action - if the deepest active one is already on index 0, a parent will handle
    • dismiss() - goBack(key) where key is the key of the navigator itself

    this is all a bit confusing, in particular when you want to deal with going back across navigators

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

No branches or pull requests

1 participant