Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native router flux reset scenes from navigation stack

I have a scene ( lets called sceneA ) where a lot of data is rendered inside a listview, so after navigating to another scene, the ui become very slow and laggy because sceneA still in the navigation stack, I tried to solve this by calling: Actions.sceneA({type: "reset"}) inside componentWillUnmount() of sceneA, but that doesn't seem to work as componentWillUnmount() is never called after navigating to another scene, so is there a way to reset previous scenes when navigating inside the app?

like image 632
Abdennacer Lachiheb Avatar asked Jul 25 '26 09:07

Abdennacer Lachiheb


1 Answers

You can use the <scene/> tag like this:

<Scene type="reset" key="someKey" component={someComponent} .../>

In this way if you go to the scene above, the navigation stack will reset.

like image 166
Vahid Boreiri Avatar answered Jul 28 '26 16:07

Vahid Boreiri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!