mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-27 22:56:07 +08:00
Routes in `MaterialTopTabNavigator` are now lazy initialized like in `MaterialBottomTabNavigator`. A scene visibility is computed from multiple states and props: To handle the pan between tabs, we check if you're currently swiping between tabs and the prop `lazyOnSwipe` is true (default value) or if the tab have been already loaded, we'll check if this tab is a sibling of the focused tab. Then, we'll display the tab if it's a sibling. ~With the prop `animationEnabled` to true, we shouldn't hide a tab before the transition is done. So we're waiting `COMPLETE_TRANSITION` action to hide it. Also, if the prop `sceneAlwaysVisible` is true (default value), we won't hide scenes between A and D while transitioning.~ If the current tab has not been loaded and must not be visible, we do not render it. I'll update the docs accordingly to this PR.  <!-- #### Default behavior Tabs are lazy initialized on swipe or focus and are always visible while transitioning.  #### Hide tabs between while transitioning ```js { sceneAlwaysVisible: false, } ```  #### Fallback to only lazy initialized tabs on focus ```js { lazyOnSwipe: false, } ```  -->