Replies: 3 comments 5 replies
-
To achieve this, you can use the useSegments() hook and conditionally hide the tabbar by setting its display property to none. You can do this by checking if segment[3] is equal to the route you want to hide, and then setting the tabBarStyle accordingly. Here's an example: import { useSegments } from 'react-native-screens';
const segment = useSegments();
<Tabs.Screen
name="chat"
options={{
tabBarIcon: ({ color }) => <TabBarIcon name="message1" color={color} />,
headerShown: false,
tabBarStyle: { display: segment[3] === "routeYouNeedToHide" ? 'none' : 'flex' }
}}
/> Hope this helps! |
Beta Was this translation helpful? Give feedback.
5 replies
-
This is the way I do it:
Here's an example |
Beta Was this translation helpful? Give feedback.
0 replies
-
My solution is similar. I used import { useSegments } from 'expo-router';
export default function TabLayout() {
const segment = useSegments();
const hideTabBar = [...segments].includes("screen-wihout-bar");
return (
<Tabs
screenOptions={{ ... }}
// if condition is satisfied return function that return null, otherwise do nothing by setting undefined
tabBar={hideTabBar ? () => null : undefined}
/>
)
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This exact same scenario is happening to me and I am trying to figure out how to nail it.
https://reactnavigation.org/docs/hiding-tabbar-in-screens/
I thought about something like this but without luck:
Is there a good human the could put me on the right direction?
Beta Was this translation helpful? Give feedback.
All reactions