Replies: 2 comments 1 reply
-
|
As far as I know, there is currently no way to pop to a specific screen. We use it like this: def update
# ...
pop_until_or_redirect_to path_2
end
Both Hotwire Native projects already have some code to prevent the previous screen from being pushed again (here in Android and here in iOS). But this only works for the previous screen. In my opinion, having a way to pop further down to a specific screen would be really valuable. It feels unintuitive to push a view onto the stack when it has already been visited. Interestingly, iOS already has a built-in function for this: popToViewController We thought about making a PR for this, haven't done so yet since we're unsure whether this behavior is desirable in every scenario. I've tried to give more attention to the apps I use daily, and most of them do indeed pop back when presenting the same screen again. Another question I’m unsure about—if we were to make this the default—is how to handle params. I would love to see support for this in Hotwire Native, perhaps instead of making this the default behavior, it could be an optional feature that developers can enable or disable as needed? |
Beta Was this translation helpful? Give feedback.
-
|
I have another problem in this area. I have web shop app so I need something like this:
When payment is done deep link goes back to my app and I need stack to look like this:
Maybe some API to set stack manually would help in both cases? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Here's how my navigation stack looks:
Now, I want to navigate from Path 4 to Path 2. How can I do that?
My personal opinion is that if a visit is proposed to a URL which exists in the navigation stack, it should automatically pop to that screen and reload.
Beta Was this translation helpful? Give feedback.
All reactions