从导航堆栈中反应本机路由器磁通重置场景

Abd*_*heb 1 navigation react-native react-native-router-flux

我有一个场景(让所谓的sceneA其中一个)大量数据的列表视图中呈现,所以导航到另一个场景后,用户界面变得非常缓慢和laggy因为sceneA通过调用仍然在导航堆栈中,我试图解决这个问题:Actions.sceneA({type: "reset"})里面componentWillUnmount()sceneA,但这似乎没有工作,因为componentWillUnmount()导航到另一个场景后从未调用,所以有没有办法在应用程序内导航时重置以前的场景?

Vah*_*iri 8

你可以使用这样的<scene/>标签:

<Scene type="reset" key="someKey" component={someComponent} .../>
Run Code Online (Sandbox Code Playgroud)

这样,如果你去上面的场景,导航堆栈将重置.