timomeh / react-native-material-bottom-navigation

💅🔧👌 a beautiful, customizable and easy-to-use material design bottom navigation for react-native
MIT License
710 stars 127 forks source link

Switching tabs reloads view #33

Closed hdchan closed 7 years ago

hdchan commented 7 years ago

Is there a way that I can program the tab views so that it does not load if I'm going back to a tab? For example, I have a table view that gets populated from a network call on tab 1, I then navigate to another tab and navigate back to tab 1, I find that it reloads the view, it makes a network call and loads loads the table view as though it dismounted the view.

timomeh commented 7 years ago

Sorry, the tab views aren't related to the BottomNavigation.

If you're using react-navigation, look through their issues. If not, SO is a great place for questions.

Hint: Load and save your fetched data in a data structure independent from your view, e.g. a redux store or something similar. That way your data isn't lost if the component gets unmounted in the meantime.