我有一个场景(我们称之为 sceneA
),其中 lot 数据在 ListView 中呈现,因此在导航到另一个场景后,ui 变得非常慢并且延迟,因为 sceneA
仍在导航堆栈中,我试图通过调用来解决此问题: Actions.sceneA({type: "reset"})
inside componentWillUnmount()
,但这似乎不起作用,因为在导航到另一个场景后永远不会调用 sceneA
的 componentWillUnmount()
,所以有没有办法重置以前的在应用内导航时的场景?
最佳答案
您可以使用 <scene/>
像这样的标签:
<Scene type="reset" key="someKey" component={someComponent} .../>
这样如果你去到上面的场景,导航栈会重置。
关于react-native - 从导航堆栈中 react native 路由器通量重置场景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46195302/