React-native-router-flux: Is their a way we can unmount each time we change a tab?

Created on 25 May 2016  路  4Comments  路  Source: aksonov/react-native-router-flux

Say I move from tab Y to tab Z, I'd want the componentWillMount method to run. If there's no way to do this, I can just implement something with componentDidUpdate.

question

Most helpful comment

Also need this fixed. One tab is connecting to the camera and needs to be unmounted. I have seen some potential using Switch.

All 4 comments

Hi @jamesone can you elaborate your question? The issue title title mentions unmount however your explanation ask for componentWillMount to run. Run where? In tab Y, Z, both tabs?

componentWillMount, componentDidUpdate are core React components they play a significant role keeping the App performance. Not sure if overriding the existing logic is the best approach.

There are multiple options than you can use to control how a component will and how be rendered. One of them is redux. You can connect tabbar event changes to your redux logic and dispatch actions that change one or more tab components.

Use React key

is there any help on the original question?

Also need this fixed. One tab is connecting to the camera and needs to be unmounted. I have seen some potential using Switch.

Was this page helpful?
0 / 5 - 0 ratings