admin管理员组文章数量:1323715
In my current scene stack, I have 3 scenes A,B and C. Going back and forth from A to B to C works fine. But I couldn't navigate back to scene A directly from scene C. Is this possible? My current code looks like this:
<Scene key="root">
<Scene key="aKey" ponent={A} />
<Scene key="bKey" ponent={B} />
<Scene key="cKey" ponent={C} />
</Scene>
So far, I've tried adding this code in my C ponent:
Actions.pop
But it only navigates back to previous scene(i.e. B ponent) and I am trying to navigate back directly to root scene (i.e. A ponent)
In my current scene stack, I have 3 scenes A,B and C. Going back and forth from A to B to C works fine. But I couldn't navigate back to scene A directly from scene C. Is this possible? My current code looks like this:
<Scene key="root">
<Scene key="aKey" ponent={A} />
<Scene key="bKey" ponent={B} />
<Scene key="cKey" ponent={C} />
</Scene>
So far, I've tried adding this code in my C ponent:
Actions.pop
But it only navigates back to previous scene(i.e. B ponent) and I am trying to navigate back directly to root scene (i.e. A ponent)
Share Improve this question asked Dec 9, 2017 at 6:34 SinghSingh 1,9883 gold badges22 silver badges31 bronze badges 02 Answers
Reset to default 5You are using Actions.pop() ; That means it will navigate to back screen . Use
Actions.reset('akey')
this will navigate to scene A directly.
As Rahul mentioned, one way of doing it is
Actions.reset('aKey')
The other approach that I figured out is
Actions.popTo('aKey')
本文标签: javascriptReact native router flux go back to root sceneStack Overflow
版权声明:本文标题:javascript - React native router flux go back to root scene - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742124137a2421860.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论