You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
react-native-router-flux v4.0.0-beta.28 (v3 is not supported)
react-native v0.52.0
Expected behaviour
Changing scene should dispose components and their 'render' methods should be called only once.
Lifecycle method - 'componentWillUnmount' is being called when switching scene.
Actual behaviour
Changing scenes makes components' render method be called multiple times (stacking for each scene change).
Component lifecycle method 'componentWillUnmount' is not called.
Steps to reproduce
For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.
When changing to scene A the render method of the component is called once.
When I change to scene B the render method of component in scene A and component in B are called.
When I change back to scene A the component A method is called two times and component B method is called one time.
This stacks up multiple times. It's like the components are living in the background and are not disposed.
Code samples:
Note - those are containers.
Router.js:
<Router>
<Scene key="root" navigationBarStyle={styles.navigationBarStyle}>
<Scene key="login" hideNavBar={true} component = {LoginContainer} title = "Login" />
<Scene key="enotMap" hideNavBar={true} component={EnotMapContainer} title = "Enot map!"/>
<Scene key="main" hideNavBar={true} component={MainContainer} title = "Home!"/>
<Scene key="filters" hideNavBar={true} component={MainContainer} title = "Home!"/>
<Scene key="poiDetailsView" hideNavBar={true} component={PoiDetailsViewContainer} title = "Details!"/>
</Scene>
</Router>
Using Actions.reset('someSceneName') disposes all the pages in the stack and thus not calling their render method each time.
I navigate to my main page by using reset to clear the stack.
Pressing back makes the app exit but that's okay in my case.
Version
Expected behaviour
Changing scene should dispose components and their 'render' methods should be called only once.
Lifecycle method - 'componentWillUnmount' is being called when switching scene.
Actual behaviour
Changing scenes makes components' render method be called multiple times (stacking for each scene change).
Component lifecycle method 'componentWillUnmount' is not called.
Steps to reproduce
For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.
Code samples:
Note - those are containers.
Router.js:
MainContainer:
Example reducer code that changes the scenes:
The text was updated successfully, but these errors were encountered: