79734416

Date: 2025-08-13 14:43:23
Score: 1
Natty:
Report link

You can solve this by using protected routes. See the documentation examples here.

export default function TabLayout() {  
return (    
<Tabs>
    <Tabs.Screen name="index" options={{ tabBarLabel: 'Home' }} />
      <Tabs.Protected guard={user === "normal" }>
        <Tabs.Screen name="normal" options={{ tabBarLabel: 'Normal Page' }} />
      </Tabs.Protected>
      <Tabs.Protected guard={user === "expert" }>
        <Tabs.Screen name="expert" options={{ tabBarLabel: 'Expert' }} />
      </Tabs.Protected>    
</Tabs>  );
}
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Patrick Schlieker