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
Remove scenes from stack #2713
Comments
What about |
@Blapi The example is very simplified version of what is really happens in application. The number of screens to remove decided by separate logic depends on data received from server on |
Not really happy about this hack because I find this ugly but you could do that : In your app.js (or wherever your Router is located), add this :
And then your Router should look like this :
You can do your stuff even if I'm not a huge fan of this trick, but you will just need to adapt your logic of course. |
If you have a data coming from the server, you can fetch it within |
@Blapi yep, looks ugly, but if that is the only way to manage the stack, then probably I have no choice. |
I don't know, I haven't checked |
@Blapi I have tried code that you suggested. |
What's the status now? |
@Blapi now? |
Yes, is it working well? Did you find a workaround? |
@Blapi Yes, it working, but I still see screen removing animation, like if I'm calling |
Unfortunately it is how react navigation works. Closing it. |
This is just ridiculous, I know React Navigation does not support this but how can that be so? This is a typical use case. @aksonov is it possible to remove scenes from stack in the 3.0 version? |
@qmegas Did you manage to get it to work? Actions.popTo('sceneName') - scene may or may not be present and we can go to previous screen by swiping from left side to right side in phone. so we can't use this exactly. Is there any workaround for this? |
popTo worked for me. |
@qmegas Here's what you should do. Wrap screen3 and screen4 into a separate Router and put that Router inside a Modal scene. Like this:
Then, when user gets to scene4, and about to go to scene5, you do this:
Your restricted scenes will open up in a modal, and they will have their own stack, so user can go back to Scene3 from Scene4, and can swipe down back to Scene2 from any scene in that new stack as well. But when user gets to Scene5, he can only swipe back to Scene2. Scene3 and Scene4 will be gone. |
Hi,
I have small question about scenes stack modification.
In my application, for example, user moves from
screen1
toscreen4
like that:screen1 => screen2 => screen3 => screen4
Then user should move from
screen4
toscreen5
. Once he does that I want him to be unable to move back toscreen3
orscreen4
. If he goes back I want him to move toscreen2
. In other words I want my scene stack become like that:screen1 => screen2 => screen5
I want to remove
screen3
andscreen4
from scenes stack. Right now I do it following way: onscreen4
I run code:But in that case I see unnecessary animation of removing screens and then opening new one. I tried to to do it like that:
but I still see animation.
So, the question: is there any way to remove scenes from stack without any visual changes on phone screen?
The text was updated successfully, but these errors were encountered: