-
Notifications
You must be signed in to change notification settings - Fork 68
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
goTo(screen) should not navigate if top of stack == screen #1317
Comments
I'd be open to this as a PR to |
The main question would be what to do if someone tries it. I'm not a big fan of silently no-op-ing 🤔 |
Yeah. I'll admit it's a bit unexpected as the caller, but I can't imagine a situation where you'd want to navigate anywhere if you passed in the same screen we're already on. Maybe some apps would want to treat this as a refresh? I guess there could be a |
Seems like a resonable guard to have. Think if you'd want to show the same
This does open up |
That's an interesting idea, and would give intercepting navigators the ability to communicate more too. I like it. I think starting with a Boolean return is good, we could look at an enum if it's really needed later |
I'm not convinced returning a boolean/enum is the right ergonomic choice but obviously this is not my project so yall are free to do what you want. That said, in my experience with Flow's I'd propose just changing the behavior, and optionally add a top-level |
Implements #1317 with the bool result return approach. Open to also going with the passed in callback which was another suggested approach.
Implemented in #1331 |
I can write an extension method that does this for me:
but I'd love for this to be the default behavior so I don't have to remember to call it anywhere there could be a duplication. Thoughts?
The text was updated successfully, but these errors were encountered: