IjzerenHein / react-navigation-shared-element

React Navigation bindings for react-native-shared-element 💫
https://github.com/IjzerenHein/react-native-shared-element
MIT License
1.27k stars 124 forks source link

Question about how tab bar is hidden while navigating in the Example project (BottomTabs2.tsx) #188

Closed dochonglo closed 2 years ago

dochonglo commented 2 years ago

Hi @IjzerenHein !! Thanks for the wonderful library and the example project. 😊

I'm interested to know how you were able to hide the tab bar under the example "BottomTabs2" for react navigation v4 and v5. I've been playing around with the demo and searching through the files, but I found no clues as to how the tab bar transitioned to hidden when navigating to the detailed screen.

I'd much appreciate your help. Thanks in advance and keep up the excellent work!

IjzerenHein commented 2 years ago

Hi! Please have a look at this from the BottomTabs2 example and think about it closely.

export default () => (
  <NavigationContainer>
    <Stack.Navigator>
      <Stack.Screen name={name} component={TabScreen} />
      <Stack.Screen name="Detail" component={DetailScreen} />
    </Stack.Navigator>
  </NavigationContainer>
);

When you navigate to the DetailScreen, the whole TabNavigator is pushed is pushed back and only DetailScreen is visible, which is inside a Stack navigator.

IjzerenHein commented 2 years ago

Closing this as the answer has been provided. Feel free to reopen with additional details if the solution didn't work